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

sanjay1688's avatar

Getting error on npm install in laravel 5.1

After installing laravel

i was doing sudo npm install

But i got following error

node-sass@3.2.0 install /var/www/html/talentxstuffs/txfrontend/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass node scripts/install.js

Binary downloaded and installed at /var/www/html/talentxstuffs/txfrontend/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-11/binding.node

node-sass@3.2.0 postinstall /var/www/html/talentxstuffs/txfrontend/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass node scripts/build.js

/var/www/html/talentxstuffs/txfrontend/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-11/binding.node exists. testing binary. Binary is fine; exiting. npm ERR! EEXIST, open '/home/sanjay/.npm/8948bf03-adable-stream-1-0-33-package-tgz.lock' File exists: /home/sanjay/.npm/8948bf03-adable-stream-1-0-33-package-tgz.lock Move it away, and try again.

npm ERR! System Linux 3.13.0-53-generic npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" npm ERR! cwd /var/www/html/talentxstuffs/txfrontend npm ERR! node -v v0.10.35 npm ERR! npm -v 1.4.28 npm ERR! path /home/sanjay/.npm/8948bf03-adable-stream-1-0-33-package-tgz.lock npm ERR! code EEXIST npm ERR! errno 47 npm ERR! not ok code 0

0 likes
7 replies
vitr's avatar

have you tried what it says?

File exists: /home/sanjay/.npm/8948bf03-adable-stream-1-0-33-package-tgz.lock Move it away, and try again.

REBELinBLUE's avatar

I was getting the same thing, but running npm upgrade -g npm seems to have fixed it

2 likes
simondavies's avatar

i had to reinstall laravel-elixir and gulp, this updated the file as well to laravel-elixir ^2.3.11.

sudo npm install gulp --save-dev

sudo npm install laravel-elixir --save-dev

once this was done i was able to run gulp again.

zuwayer's avatar

Upgrade node/npm to latest and it should solve the problem.

miguelvaladez's avatar

Was having the same problem ended up running "sudo npm install -g npm@latest " as suggested by @sanjay1688 then followed up with sudo installs of both gulp and laravel-elixir as suggested by @simondavies which also updated the elixir version to 3.0.5

Farhan's avatar

Best and easiest way for windows is:

open folder C:\Users\username\AppData\Roaming\npm-cache

open cmd (run as administrator)

cd laravel-path

npm install --no-bin-links

Now you need to find *.lock file (replace * with file name which npm given you in error log)

delete it manually, you need to repeat it at least 2 times after start and after cmd showing "Binary is fine; exiting."

That's it !

Please or to participate in this conversation.