我在尝试在Mac上安装Ionic时遇到了相当大的麻烦。我已尝试在网上发布的所有建议都没有成功。我尝试以root身份安装,使用sudo,你可以命名。
使用Homebrew我已经成功安装了node:v6.10.0和npm v4.1.2。
Issuing: "npm install -g cordova ionic"
Results in:
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
npm ERR! node v6.10.0
npm ERR! npm v4.1.2
npm ERR! path /Users/craigmaxey/.npm
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall mkdir
npm ERR! Error: EPERM: operation not permitted, mkdir '/Users/craigmaxey/.npm'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, mkdir '/Users/craigmaxey/.npm'
npm ERR! at Error (native)
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/Users/craigmaxey/.npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
npm ERR! node v6.10.0
npm ERR! npm v4.1.2
npm ERR! path npm-debug.log.3262676290
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall open
npm ERR! Error: EPERM: operation not permitted, open 'npm-debug.log.3262676290'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, open 'npm-debug.log.3262676290'
npm ERR! at Error (native)
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.3262676290' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/craigmaxey/npm-debug.log
答案 0 :(得分:0)
此:
int
表示您在EPERM: operation not permitted, mkdir '/Users/craigmaxey/.npm'
上缺少写权限。通常,您可以通过使用/Users/craigmaxey/.npm
:
sudo
如果这对您不起作用(因为您提到过您已经尝试过sudo npm install -g cordova ionic
),请添加运行此完全完全错误消息>命令。