【发布时间】:2016-08-26 05:04:16
【问题描述】:
我正在尝试在我的 Mac 上使用 npm 安装 Ionic,运行 OSX El Capitan 10.11.2。
sudo npm install -g cordova ionic
Cordova 已经安装,而且我确实输入了正确的密码。以下是错误消息和日志:
Last login: Sun May 1 18:41:17 on ttys001
egaumbp:~ gg$ sudo npm install -g cordova ionic
Password:
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
/usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic
> node-sass@3.4.2 install /usr/local/lib/node_modules/ionic/node_modules/node-sass
> node scripts/install.js
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
path.js:424
var path = (i >= 0) ? arguments[i] : process.cwd();
^
Error: EACCES: permission denied, uv_cwd
at Error (native)
at Object.posix.resolve (path.js:424:50)
at startup (node.js:96:32)
at node.js:968:3
npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
npm ERR! node v4.4.1
npm ERR! npm v2.14.20
npm ERR! code ELIFECYCLE
npm ERR! node-sass@3.4.2 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.4.2 install script 'node scripts/install.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/gg/npm-debug.log
egaumbp:~ gg$
有解决办法吗?
【问题讨论】:
-
我也有同样的问题
-
@ThomasBredillet 自己找到了解决方案。在下面检查我的答案。
-
@ThomasBredillet 我已在Medium 上发布此消息
标签: macos cordova ionic-framework npm