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

4xjbh's avatar

NPM Install Error

I have just installed homestead locally with my project and the vm is up and running. When I run gulp its telling me the laravel dependancies are not installed

I run 'npm instal'l and I get the following error. (sudo doesn't help). It also looks like the laravel-elixir and bootstrap-sass folders are empty in the project folder.

What should I do next?

vagrant@proactive:~/proactive$ npm install
npm ERR! Error: ENOTEMPTY, rmdir '/home/vagrant/proactive/node_modules/laravel-elixir/node_modules/watchify/node_modules/browserify/node_modules/insert-module-globals/node_modules/combine-source-map/node_modules/convert-source-map/test/fixtu
res'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/vagrant/proactive
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
npm ERR! path /home/vagrant/proactive/node_modules/laravel-elixir/node_modules/watchify/node_modules/browserify/node_modules/insert-module-globals/node_modules/combine-source-map/node_modules/convert-source-map/test/fixtures
npm ERR! code ENOTEMPTY
npm ERR! errno 53
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/home/vagrant/proactive/node_modules/laravel-elixir/node_modules/watchify/node_modules/browserify/node_modules/insert-module-globals/node_modules/combine-source-map/node_modules/convert-so
urce-map/test/fixtures'
npm ERR! error rolling back  { [Error: ENOTEMPTY, rmdir '/home/vagrant/proactive/node_modules/laravel-elixir/node_modules/watchify/node_modules/browserify/node_modules/insert-module-globals/node_modules/combine-source-map/node_modules/conver
t-source-map/test/fixtures']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/home/vagrant/proactive/node_modules/laravel-elixir/node_modules/watchify/node_modules/browserify/node_modules/insert-module-globals/node_modules/combine-source-map/node_modules/convert-source-map/test/fi
xtures' }
npm ERR! not ok code 0
0 likes
4 replies
mattythebatty's avatar

I get this all the time installing on Windows.

As far as I can tell there is no easy fix but I normally get to work by repeatedly installing until it works.

Run npm cache clear before npm install in case a package that node cached after downloading is corrupted. It's taken me over 10 attempts to work before.

I also had an issue once where a npm was just creating a load of empty directories so in this case maybe delete the /home/vagrant/proactive/node_modules/laravel-elixir/node_modules/watchify/ folder manually

4xjbh's avatar

I moved my project folder to c:\Code\ and Homestead into the root of my home drive (windows) and it seems to be working. Long folder/file path names was the problem

'sudo' or 'sudo bash'
npm install --global gulp
npm install --no-bin-links
added : var gulp = require('gulp'); to gulpfile.js

remember gulp-notify wont work with windows, others use growl for windows. http://www.growlforwindows.com/gfw/

And remember 'The definition of insanity is doing the same thing over and over and expecting different results.'

4xjbh's avatar

Moved to linux for developing. :-D

Please or to participate in this conversation.