sudo npm install -g ios-deploy error

3

我正在尝试学习Cordova/PhoneGap,并且目前正在学习“Build”相关内容。根据我正在遵循的教程,我需要使用sudo npm install -g ios-sim命令进行安装。安装成功后,教程告诉我需要安装ios-deploy。于是我执行了sudo npm install -g ios-deploy命令,但是出现了一个错误:

Desktop/Cordova/myApp$ sudo npm install -g ios-deploy
npm WARN lifecycle ios-deploy@1.9.0~preinstall: cannot run in wd %s %s (wd=%s) ios-deploy@1.9.0 ./src/scripts/check_reqs.js && xcodebuild /usr/local/lib/node_modules/.staging/ios-deploy-298c9491
npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ios-deploy"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
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 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/jasoncuray/Desktop/Cordova/myApp/npm-debug.log

请问有人能帮我解决这个问题吗?我是个新手,只是想从教程中学习。谢谢!我使用的是2015年款的Macbook Pro,在按照教程操作前已经完成了所有安装。

1个回答

5

使用此方法解决问题:

npm install -g ios-deploy --unsafe-perm=true

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接