在Mac上安装Cordova时出错 [英] Error when install Cordova on Mac
问题描述
我试图使用npm安装Cordova,但是花了一个多小时,然后我放弃了.后来我尝试遵循 http://cordova.apache.org/的指示,并且在我执行了npm install -g ios-deploy
.
这是我在命令行中看到的:
YangHenrydeMacBook-Pro:〜Yong $ sudo npm install -g ios-deploy npm WARN生命周期ios-deploy@1.8.3~预安装:无法在wd%s%s(wd =%s)ios-deploy@1.8.3中运行. xcodebuild/usr/local/lib/node_modules/.staging/ios-deploy-fbfd9f76b9a8909271fae167aab47715
npm ERR!达尔文14.4.0
npm ERR! argv"/usr/local/bin/node""/usr/local/bin/npm"安装""-g""ios-deploy"
npm ERR!节点v5.1.1
npm ERR! npm v3.3.12
npm ERR!路径/usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy
npm ERR!代码ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT:没有这样的文件或目录,chmod'/usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy'
npm ERR! enoent这很可能不是npm本身的问题
npm ERR! enoent,与npm无法找到文件有关.
npm ERR! enoent
npm ERR!请在支持请求中包括以下文件:
npm ERR!/Users/Yong/npm-debug.log
有人可以给我一些提示吗?谢谢!
出于完整性考虑,@ Sam003的答案是正确的,使用--unsafe-perm=true
是按节点推荐的在MacOS 10.11及更高版本下安装模块的方法./p>
从nmp安装:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!! WARNING: You are on OS X 10.11 El Capitan or greater, you may need to add the
!!!! WARNING: `--unsafe-perm=true` flag when running `npm install`
!!!! WARNING: or else it will fail.
!!!! WARNING: link:
!!!! WARNING: https://github.com/phonegap/ios-deploy#os-x-1011-el-capitan
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I was trying to install Cordova by using npm, but it took more than one hour, and then I gave up. Later I tried to follow the instruction from http://cordova.apache.org/, and the error occurred when I executed npm install -g ios-deploy
.
Here is what I get in command line:
YangHenrydeMacBook-Pro:~ Yong$ sudo npm install -g ios-deploy npm WARN lifecycle ios-deploy@1.8.3~preinstall: cannot run in wd %s %s (wd=%s) ios-deploy@1.8.3 ./src/check_reqs.js && xcodebuild /usr/local/lib/node_modules/.staging/ios-deploy-fbfd9f76b9a8909271fae167aab47715
npm ERR! Darwin 14.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ios-deploy"
npm ERR! node v5.1.1
npm ERR! npm v3.3.12
npm ERR! path /usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Yong/npm-debug.log
Could anyone give me some hints? Thanks!
For completeness sake, @Sam003's answer is right, using the --unsafe-perm=true
is the recommended-by-node way to install modules under MacOS 10.11 and later.
From an nmp install:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!! WARNING: You are on OS X 10.11 El Capitan or greater, you may need to add the
!!!! WARNING: `--unsafe-perm=true` flag when running `npm install`
!!!! WARNING: or else it will fail.
!!!! WARNING: link:
!!!! WARNING: https://github.com/phonegap/ios-deploy#os-x-1011-el-capitan
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
这篇关于在Mac上安装Cordova时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!