Question

I am trying to install bower on a vagrant machine using following command

npm install -g bower

but i am getting following error

            npm WARN prefer global bower@1.3.2 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

It seems that bower is not simplly gets installed on a windows machine. Please help in issue. Any help will be appericiated.

Was it helpful?

Solution

You need root access for global install.

sudo npm install -g bower

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top