嗨,我正在尝试使用 npm 安装cordova
sudo npm install -g cordova
我有这个错误
npm ERR! Error: EACCES, symlink '../lib/node_modules/cordova/bin/cordova'
npm ERR! { [Error: EACCES, symlink '../lib/node_modules/cordova/bin/cordova']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '../lib/node_modules/cordova/bin/cordova' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "cordova"
npm ERR! cwd /Users/yannickghilardi
npm ERR! node -v v0.10.21
npm ERR! npm -v 1.3.11
npm ERR! path ../lib/node_modules/cordova/bin/cordova
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, symlink '../lib/node_modules/cordova/bin/cordova'
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR! { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "cordova"
npm ERR! cwd /Users/yannickghilardi
npm ERR! node -v v0.10.21
npm ERR! npm -v 1.3.11
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/yannickghilardi/npm-debug.log
npm ERR! not ok code 0
然后我尝试使用这个命令 sudo chown -R yannickghilardi /usr/local/lib/node_modules 我有这个错误信息
Operation not permitted
这个问题有解决方案吗?提前致谢