在OSX上拒绝Ionic 2权限 [英] Ionic 2 Permission Denied on OSX

查看:148
本文介绍了在OSX上拒绝Ionic 2权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Windows环境中构建的Ionic 2项目。我刚刚在OSX环境中设置了Ionic 2.

I have an Ionic 2 project I built in a Windows environment. I have just set up Ionic 2 in an OSX environment.


Your system information:

Cordova CLI:  You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.4.0

Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v6.9.4
Xcode version: Not installed


但是当我运行 ionic serve 我收到以下错误:

But when I run ionic serve I get the following error:

Richards-MacBook-Pro:theWhoZoo-chat richardmarais$ sudo ionic serve
******************************************************
 Dependency warning - for the CLI to run correctly,      
 it is highly recommended to install/upgrade the following:     

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`
 Install ios-sim to deploy iOS applications.`npm install -g ios-sim` (may require sudo)
 Install ios-deploy to deploy iOS applications to devices.  `npm install -g ios-deploy` (may require sudo)

******************************************************

> ionic-hello-world@ ionic:serve /Users/richardmarais/Development/ionic/theWhoZoo-chat
> ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

sh: /Users/richardmarais/Development/ionic/theWhoZoo-chat/node_modules/.bin/ionic-app-scripts: Permission denied

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "ionic:serve" "--" "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the ionic-hello-world@ ionic:serve script 'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'.
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 serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
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/richardmarais/Development/ionic/theWhoZoo-chat/npm-debug.log
There was an error serving your Ionic application: There was an error with the spawned command: serve

感谢任何帮助。

推荐答案

你有权限问题

sh: /Users/richardmarais/Development/ionic/theWhoZoo-chat/node_modules/.bin/ionic-app-scripts: Permission denied

选项1:将权限更改为npm的默认目录

Option 1: Change the permission to npm's default directory

选项2:将npm的默认目录更改为另一个目录

Option 2: Change npm's default directory to another directory

选项3:使用包管理器为您处理此问题。

Option 3: Use a package manager that takes care of this for you.

有关详细信息,请访问以下链接: https://docs.npmjs.com/getting-started/fixing-npm-permissions

For further information follow the link : https://docs.npmjs.com/getting-started/fixing-npm-permissions

这篇关于在OSX上拒绝Ionic 2权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆