Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ValsiS's avatar
Level 10

Where i wrong ? npm install - error

Hello,

I setup on an Windows OS the Homestead VM, everything was ok, i was able to access the homestead.app,

but... in the Git Bash console i used the vagrant ssh to login to the homestead and there when i tried to install Laravel Elixir i received the next error



vagrant@homestead:~/Projects/CRM$ npm install --global gulp
npm ERR! Linux 3.16.0-23-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--global" "gulp"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path /usr/bin/gulp
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, unlink '/usr/bin/gulp'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, unlink '/usr/bin/gulp'] errno: -13, code: 'EACCES', path: '/usr/bin/gulp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, unlink '/usr/bin/gulp'
npm ERR! error rolling back     at Error (native)
npm ERR! error rolling back  { [Error: EACCES, unlink '/usr/bin/gulp'] errno: -13, code: 'EACCES', path: '/usr/bin/gulp' }
npm ERR! Linux 3.16.0-23-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--global" "gulp"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path npm-debug.log.de85a19d4280733d85aa813995491c22
npm ERR! code ETXTBSY
npm ERR! errno -26

npm ERR! ETXTBSY, rename 'npm-debug.log.de85a19d4280733d85aa813995491c22'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/Projects/CRM/npm-debug.log
vagrant@homestead:~/Projects/CRM$

That was a fresh install of Laravel, of everything ...

0 likes
13 replies
bashy's avatar
bashy
Best Answer
Level 65

NO SUDO! PLZ :P

Does npm and node commands work without installing stuff? Looks like your setup/permissions are messed.

You can fix them with this

npm config set prefix ~/npm

// append to .bashrc or similar
export PATH="$PATH:$HOME/npm/bin"
3 likes
ValsiS's avatar
Level 10

@bashy ty

the npm install --global gulp was ok now, but i have the next problem for npm install

  • this is very strange :(

vagrant@homestead:~/Projects/CRM$ npm install
npm WARN optional dep failed, continuing fsevents@0.3.6
npm ERR! tar.unpack untar error /home/vagrant/.npm/number-is-nan/1.0.0/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/number-is-nan/1.0.0/package.tgz

> node-sass@3.2.0 install /home/vagrant/Projects/CRM/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /home/vagrant/Projects/CRM/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-14/binding.node

> node-sass@3.2.0 postinstall /home/vagrant/Projects/CRM/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass> node scripts/build.js

` /home/vagrant/Projects/CRM/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-14/binding.node ` exists.
 testing binary.
Binary is fine; exiting.
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/CRM/node_modules/laravel-elixir/node_modules/gulp-phpspec/node_modules/gulp-todo/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/indent-string/node_modules/repeating/node_modules/is-finite/node_modules/number-is-nan
npm ERR! code EPROTO
npm ERR! errno -71

npm ERR! EPROTO, mkdir '/home/vagrant/Projects/CRM/node_modules/laravel-elixir/node_modules/gulp-phpspec/node_modules/gulp-todo/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/indent-string/node_modules/repeating/node_modules/is-finite/node_modules/number-is-nan'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
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 npm-debug.log.cfe025dd64df1e2d93d4b56aae15fa11
npm ERR! code ETXTBSY
npm ERR! errno -26

npm ERR! ETXTBSY, rename 'npm-debug.log.cfe025dd64df1e2d93d4b56aae15fa11'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/Projects/CRM/npm-debug.log
vagrant@homestead:~/Projects/CRM$ gulp

bashy's avatar

Erm, have you tried deleting the node_modules folder and done a install again? When I first used npm stuff a year ago, I found it sometimes messes up depending on how you installed it.

ValsiS's avatar
Level 10

It's imposible for me to make that "npm install" to work ...

it was a clean install, i did exactly how is in documentation

ValsiS's avatar
Level 10

now i know what is the problem

on package.json i have the next version of laravel-elixir

"laravel-elixir": "^2.0.0"

it's imposible for me to install that, but i changed to version 1.0.0 and everything was ok

RailsRunner's avatar

My experience is that with windows is you need to do "npm install --no-bin-links" according to Laravel 5.1 Elixir docs, as well as use "gulp" in windows command prompt as as administrator. I have tried to run gulp in the VM Homestead and get errors.

2 likes
Ridlwan's avatar

when I do "npm-install" its always download so many dependency, and take so long time. Is this fine ? Thx.

Jhourlad's avatar

Now that last one is a post killer. Please, if you have a question other than the current one, open up a new thread. You are killing an open question.

2 likes
asifmushtaq's avatar

If you are developing on a Windows system or you are running your VM on a Windows host system, you may need to run the npm install command with the --no-bin-links switch enabled:

npm install --no-bin-links

Check the documentation Laravel Elixir - Installation & Setup

1 like
lperry65's avatar

--no-bin-links does not help me, I still get errors even after deleting the node modules directory.

PadreAlessandro's avatar

I faced the same "npm install" error on Windows OS and Homestead Virtual Machine. Fortunately, I found an easy solution - Laragon. It is a high performance local development environment. I reinstalled Laravel with Laragon instead of Homestead, and all the errors are gone!

And don't be afraid of reinstalling the Laravel. With Laragon its really fast and easy. Watch this 3 minute screencast https://www.youtube.com/watch?v=pHQOdXY2AZU. Give it a try.

vinchhi's avatar

Ensure that your name in the project.json file is not the name of the package. Also try upgrading your node version manually to the latest one. U can search up how to do that. The automatic 'latest' one is not really the latest one.

Please or to participate in this conversation.