我运行ionic build ios命令时权限被拒绝错误?

时间:2017-07-05 06:14:07

标签: ios cordova ionic2

我跑的时候

  

离子构建ios

我收到以下错误。

sh:/Users/imac/Documents/TGF_IOS/node_modules/.bin/ionic-app-scripts:Permission denied

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "ionic:build" "--"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@0.0.0 ionic:build: `ionic-app-scripts build`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the ionic-hello-world@0.0.0 ionic:build script 'ionic-app-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ionic-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/imac/Documents/TGF_IOS/npm-debug.log

任何帮助将不胜感激.. 提前致谢

1 个答案:

答案 0 :(得分:0)

最后我得到了解决方案。

第一步检查您是否拥有项目文件夹的权限(读/写)。

其次,使用sudo运行此命令,

sudo npm install @ionic/app-scripts@latest --save-dev

这将安装最新的应用程序脚本并解决问题。