3
我在我的Mac上安裝了NodeJS。安裝MAC OS X後出錯El Capitan
$ node -v
v4.2.1
我想安裝涼亭。下面是結果:
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! path /usr/local/lib/node_modules/bower
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rmdir
npm ERR! Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/bower'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/bower']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rmdir',
npm ERR! path: '/usr/local/lib/node_modules/bower' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/bower'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/bower']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back syscall: 'rmdir',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/bower' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Kevin/Sites/npm-debug.log
我試圖做的:
$ sudo chown -R $(whoami) ~/.npm
chown: /Users/Kevin/.npm/_locks: Operation not permitted
chown: /Users/Kevin/.npm/bower/1.6.3/package/package.json: Operation not permitted
chown: /Users/Kevin/.npm/bower/1.6.3/package: Operation not permitted
chown: /Users/Kevin/.npm/bower/1.6.3/package.tgz: Operation not permitted
chown: /Users/Kevin/.npm/bower/1.6.3: Operation not permitted
chown: /Users/Kevin/.npm/bower: Operation not permitted
chown: /Users/Kevin/.npm/n: Operation not permitted
好像我沒有權限的。 我無法安裝任何東西。
我該如何解決這個問題?
你做了什麼安裝? –
我用下載的.pkg安裝它,而不是用自制軟件。並且在爲「涼亭安裝-g涼亭」 – Kevin
和「sudo npm安裝-g涼亭」工作後? –