2014-04-17 213 views
0

我试图用一个流浪者机器上安装亭子下面的命令流浪汉机

npm install -g bower 

但鲍尔安装我收到以下错误

  npm WARN prefer global [email protected] should be installed with -g 
      npm http GET https://registry.npmjs.org/bower 
      npm http 200 https://registry.npmjs.org/bower 
      [4mRunning "watch" task[24m 
      Waiting...npm http GET https://registry.npmjs.org/bower/-/bower-1.3.2.tgz 
      npm http 200 https://registry.npmjs.org/bower/-/bower-1.3.2.tgz 
      npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/bower' 
      npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/bower'] 
      npm ERR! errno: 3, 
      npm ERR! code: 'EACCES', 
      npm ERR! path: '/usr/lib/node_modules/bower', 
      npm ERR! fstream_type: 'Directory', 
      npm ERR! fstream_path: '/usr/lib/node_modules/bower', 
      npm ERR! fstream_class: 'DirWriter', 
      npm ERR! fstream_stack: 
      npm ERR! [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23', 
      npm ERR!  '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53', 
      npm ERR!  'Object.oncomplete (fs.js:107:15)' ] } 
      npm ERR! 
      npm ERR! Please try running this command again as root/Administrator. 

      npm ERR! System Linux 3.2.0-23-generic-pae 
      npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "bower" "--no-bin-links" 
      npm ERR! cwd /vagrant 
      npm ERR! node -v v0.10.26 
      npm ERR! npm -v 1.4.3 
      npm ERR! path /usr/lib/node_modules/bower 
      npm ERR! fstream_path /usr/lib/node_modules/bower 
      npm ERR! fstream_type Directory 
      npm ERR! fstream_class DirWriter 
      npm ERR! code EACCES 
      npm ERR! errno 3 
      npm ERR! stack Error: EACCES, mkdir '/usr/lib/node_modules/bower' 
      npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23 
      npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53 
      npm ERR! fstream_stack Object.oncomplete (fs.js:107:15) 
      npm ERR! 
      npm ERR! Additional logging details can be found in: 
      npm ERR!  /vagrant/npm-debug.log 
      npm ERR! not ok code 0 
      /tmp/vagrant-shell: line 44: bower: command not found 

看来,凉亭不simplly得到安装在Windows机器上。 请帮助。 任何帮助将被视为appericiated。

回答

2

您需要root访问才能进行全局安装。

sudo npm install -g bower