Npm install error inside Homestead machine.

Posted 4 years ago by JorgeJimenez

I was trying to install laravel-elixir with sudo npm install inside my homestead environment and I got this error:

npm ERR! tar.unpack untar error /home/vagrant/.npm/laravel-elixir/1.0.3/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp/3.8.11/package.tgz
npm ERR! Linux 3.16.0-23-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path /home/vagrant/Projects/dmca-app/node_modules/laravel-elixir/package.json
npm ERR! code EPERM
npm ERR! errno -1

npm ERR! Error: EPERM, chown '/home/vagrant/Projects/dmca-app/node_modules/laravel-elixir/package.json'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM, chown '/home/vagrant/Projects/dmca-app/node_modules/laravel-elixir/package.json']
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/home/vagrant/Projects/dmca-app/node_modules/laravel-elixir/package.json',
npm ERR!   fstream_finish_call: 'chown',
npm ERR!   fstream_type: 'File',
npm ERR!   fstream_path: '/home/vagrant/Projects/dmca-app/node_modules/laravel-elixir/package.json',
npm ERR!   fstream_class: 'FileWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/writer.js:308:19',
npm ERR!      '/usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:143:7',
npm ERR!      'FSReqWrap.oncomplete (evalmachine.<anonymous>:95:15)' ] }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/Projects/dmca-app/npm-debug.log

I tried to install gulp globally and I updated node and nothing. My OS is OS X Yosemite. Looks like permission error but I am not sure how can I fix it. Any suggestions please?

Please sign in or create an account to participate in this conversation.