Jorge Luis Jiménez
Jorge Luis Jiménez

Reputation: 1308

I can't install laravel-elixir in my Homestead VM

I am following a tutorial and I see they install laravel-elixir with sudo npm install. However when I try to do the same I got this error:

vagrant@homestead:~/Projects/dmca-app$ sudo npm install
npm ERR! tar.unpack untar error /home/vagrant/.npm/gulp/3.8.11/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/laravel-elixir/1.0.3/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/gulp/package.json
npm ERR! code EPERM
npm ERR! errno -1

npm ERR! Error: EPERM, chown '/home/vagrant/Projects/dmca-app/node_modules/gulp/package.json'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM, chown '/home/vagrant/Projects/dmca-app/node_modules/gulp/package.json']
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/home/vagrant/Projects/dmca-app/node_modules/gulp/package.json',
npm ERR!   fstream_finish_call: 'chown',
npm ERR!   fstream_type: 'File',
npm ERR!   fstream_path: '/home/vagrant/Projects/dmca-app/node_modules/gulp/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

it looks like a admin problem but I am using sudo.(OS X Yosemite) Any ideas? please.

Upvotes: 2

Views: 701

Answers (1)

Jorge Luis Jim&#233;nez
Jorge Luis Jim&#233;nez

Reputation: 1308

Yes, I did Michal. I noticed my package.json looked like that

{ "private": true, "devDependencies": { "gulp": "^3.8.8", "laravel-elixir": "*" } }

I don't know why I had the first line but I checked others laravel installation and I can't see this line. I removed the first line

{ "devDependencies": { "gulp": "^3.8.8", "laravel-elixir": "*" } }

after that I ran in the terminal

npm cache clean

and then

npm install

and I could install gulp and laravel-elixir. Even I posted this answer in https://laracasts.com/discuss/channels/general-discussion/npm-install-error-inside-homestead-machine?page=1#reply-63764 and somebody told me that it worked for him.

Upvotes: 2

Related Questions