npm没有在OSX 10.10.1上安装bower

时间:2015-02-10 17:57:56

标签: npm osx-yosemite

有人知道如何解决这个问题吗?

/Users/foo $npm install -g bower

npm http request GET https://registry.npmjs.org/bower

npm http 200 https://registry.npmjs.org/bower

npm http fetch GET https://registry.npmjs.org/bower/-/bower-1.3.12.tgz

npm http fetch 200 https://registry.npmjs.org/bower/-/bower-1.3.12.tgz

npm ERR! Darwin 14.0.0

npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "bower"

npm ERR! node v0.12.0

npm ERR! npm v2.5.1

npm ERR! path /Users/foo/.node/bin/bower

npm ERR! code EACCES

npm ERR! errno -13

npm ERR! Error: EACCES, unlink '/Users/foo/.node/bin/bower'

npm ERR! at Error (native)

npm ERR! { [Error: EACCES, unlink '/Users/foo/.node/bin/bower'

npm ERR! errno: -13,

npm ERR! code: 'EACCES'

npm ERR! path: '/Users/foo/.node/bin/bower' }

npm ERR!

npm ERR! Please try running this command again as root/Administrator.

npm ERR! error rolling back Error: EACCES, unlink'/Users/foo/.node/bin/bower'

npm ERR! error rolling back at Error (native)

npm ERR! error rolling back { [Error: EACCES, unlink '/Users/foo/.node/bin/bower']

npm ERR! error rolling back errno: -13,

npm ERR! error rolling back code: 'EACCES',

npm ERR! error rolling back path: '/Users/foo/.node/bin/bower' } `` npm ERR! Please include the following file with any support request:

npm ERR! /Users/foo/npm-debug.log

/Users/foo$echo $PATH

/Users/foo/.npm:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/mysql/bin :/opt/X11/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

1 个答案:

答案 0 :(得分:1)

您是否尝试过以root用户身份运行它?试试

sudo npm install -g bower

npm ERR!代码EACCES通常会产生,因为它没有访问必要文件夹或文件的权限