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

jimmyhowedotcom's avatar

Gulp not working with new install of laravel

I get the following error when running gulp after a new install of Laravel

module.js:340
    throw err;
    ^

Error: Cannot find module 'vinyl'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:289:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous>   (C:\Users\jimmy\AppData\Roaming\npm\node_modules\gulp\node_modules\ gulp-util\index.js:2:9)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
0 likes
10 replies
mstnorris's avatar

What version of node are you using and have you installed gulp?

Did you run npm install from your project root?

jimmyhowedotcom's avatar

Hey, I was using the latest version of node, and had problems... now I'm using stable version again.

I ran npm install gulp -g again after install, and the gulp from my root and now i get following error...

(and I've ran npm install from root)

[16:45:16] Using gulpfile P:\Code\PHP\Domains\tonyspizzeria.uk\gulpfile.js
[16:45:16] Starting 'default'...
[16:45:16] Starting 'sass'...
[16:45:16] 'sass' errored after 25 ms
[16:45:16] Error: The `libsass` binding was not found in P:\Code\PHP\Domains\tonyspizzeria.uk\node_modules\node-    sass\vendor\win32-x64-46\binding.node
This usually happens because your node version has changed.
Run `npm rebuild node-sass` to build the binding for your current node version.
    at Object.sass.getBinaryPath (P:\Code\PHP\Domains\tonyspizzeria.uk\node_modules\node-sass\lib\extensions.js:158:11)
    at Object.<anonymous> (P:\Code\PHP\Domains\tonyspizzeria.uk\node_modules\node-sass\lib\index.js:16:36)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (P:\Code\PHP\Domains\tonyspizzeria.uk\node_modules\gulp-sass\index.js:176:21)
    at Module._compile (module.js:435:26)
[16:45:16] Error in plugin 'run-sequence'
Message:
    An error occured in task 'sass'.
[16:45:16] Finished 'default' after 34 ms
mstnorris's avatar

Did you run npm rebuild node-sass as per the error?

shincoder's avatar

Some packages are tied to node version you are running, if it's changed, they should be rebuilt.

npm rebuild node-sass

1 like
mehany's avatar

@jimmyhowe How did you start your new installation of laravel? I just tried one and it works! can you try to remove your node_modules folder and run npm install

 //check versions
npm -v
node -v
gulp -version

Here are mine:

OSX 10.11
Laravel Framework version 5.1.24 (LTS)
npm -v 
3.3.6
node -v 
v5.0.0
gulp -version
CLI version 3.9.0
LarryMarzanJr's avatar

Say @jimmyhowe, what's the recommended version for mine?

Ubuntu 14.04 LTS
Laravel Framework version 5.2.27

My current version is:

npm -v
3.8.3
node -v
v0.10.43
gulp -version
[17:18:41] CLI version 1.2.1
[17:18:41] Local version 3.9.1

What should be the recommended version using my current Distro and Laravel Framework?

LarryMarzanJr's avatar

Yeah @jimmyhowe I already figured this version works for me:

npm -v
3.6.0
node -v
v5.7.0
gulp -version
[02:12:38] CLI version 3.9.1
[02:12:38] Local version 3.9.1

Thanks.

Well, I ended up using homestead :) all-in-one recommended version.

willvincent's avatar

v0.10.43

That's a really old version of node!

I always recommend people use nvm so that they can easily switch between active node versions.

Amidamaru's avatar

@mstnorris @jimmyhowe @mehany

I am also trying to run gulp in my virtual machine. I am using windows 8.1 for my virtual machine. This is the current version installed for my project

vagrant@homestead:~/sites/laravel5$ php artisan --version
Laravel Framework version 5.2.22
vagrant@homestead:~/sites/laravel5$ npm -v
3.8.3
vagrant@homestead:~/sites/laravel5$ node -v
v5.10.1
vagrant@homestead:~/sites/laravel5$ gulp -v
[06:33:48] CLI version 3.9.1
[06:33:48] Local version 3.9.1

When i execute gulp command it prompts me with:

module.js:341
    throw err;
    ^
Error: Cannot find module 'laravel-elixir'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)

When i run npm install command, it creates node_modules folder. Please let me know

Please or to participate in this conversation.