Filip_Zdravkovic's avatar

Laravel 5.3.16: gulp ERRORS

Ok, there is a problem with Laravel 5.3.16 (with Laravel **5.3.10** and 5.2 there weren't such problems).

1. I run the following command: npm install

2. Then, when I run: gulp I get the following:

> C:\Users\*******\AppData\Roaming\npm\gulp.cmd
[18:35:36] Local gulp not found in C:\xampp\htdocs\laravel-vue
[18:35:36] Try running: npm install gulp

This never happened with Laravel 5.2 and **5.3.10**.

3. So, I run the npm install gulp command.

4. After that, when I run gulp again, I am getting this:

module.js:457
    throw err;
    ^

Error: Cannot find module 'laravel-elixir'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\xampp\htdocs\laravel-vue\gulpfile.js:1:78)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

5. npm install laravel-elixir

6. And now, when I run gulp again:

module.js:457
    throw err;
    ^

Error: Cannot find module 'laravel-elixir-vue-2'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\xampp\htdocs\laravel-vue\gulpfile.js:3:1)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

7. So I run: npm install laravel-elixir-vue-2 --save-dev

8. Finally, when I run gulp again:

C:\xampp\htdocs\laravel-vue\node_modules\laravel-elixir-vue-2\index.js:4
  Elixir.webpack.mergeConfig({
                ^

TypeError: Cannot read property 'mergeConfig' of undefined
    at C:\xampp\htdocs\laravel-vue\node_modules\laravel-elixir-vue-2\index.js:4:17
    at C:\xampp\htdocs\laravel-vue\node_modules\laravel-elixir\dist\index.js:29:16
    at Array.forEach (native)
    at global.Elixir (C:\xampp\htdocs\laravel-vue\node_modules\laravel-elixir\dist\index.js:28:24)
    at Object.<anonymous> (C:\xampp\htdocs\laravel-vue\gulpfile.js:16:1)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

And I don't know what to do. This is really frustrating :> With Laravel 5.2 (and 3.10) everything worked fine, but now...

I am using Windows 7 (XAMPP).

0 likes
9 replies
JoolsMcFly's avatar

package.json still refers to laravel-elixir-vue

Change it to:

"laravel-elixir-vue-2": "^0.2.0",

and you should be good to go.

GuntarV's avatar

Similar issue here. Installing Gulp went well, but when I try to start Gulp from cmd I get these errors: TypeError: Cannot read property 'mergeConfig' of undefined at E:\Web\wamp64\www\blog\node_modules\laravel-elixir-vue\main.js:4:19 at E:\Web\wamp64\www\blog\node_modules\laravel-elixir\dist\index.js:29:16 at Array.forEach (native) at global.Elixir (E:\Web\wamp64\www\blog\node_modules\laravel-elixir\dist\index.js:28:24) at Object. (E:\Web\wamp64\www\blog\gulpfile.js:16:1) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17)

ejdelmonico's avatar

Sounds like your npm install is messed up. When things like that happen to me, I usually just delete the node_modules folder and run npm install again.

Filip_Zdravkovic's avatar

@ejdelmonico I tried that, but the same problems still exist. There are no such problems when running the gulp command with Laravel 5.2 and 5.3.10.

Vlahde's avatar

I had exactly the same issue but this worked for me: I updated npm to 6.9 and removed the node_modules folder and then run npm install again. After that gulp command ran smoothly!

1 like
Filip_Zdravkovic's avatar
Level 7

Ok, I updated npm:

npm install npm@latest -g

Now it's 3.10.9

Then I did the following:

npm install --global gulp-cli
npm install --no-bin-links
gulp

and there was this error:

Error: ENOENT: no such file or directory, scandir ' ... /node_modules/node-sass/vendor'

The solution is to run the following command:

npm rebuild node-sass

And, finally, no more errors.

2 likes
grappling1's avatar

Is there any other work around found yet? I'm running into the exact same problem with exact same steps taken. I've tried Filip_Zdravkovic's fix yet still get the same error of "TypeError: Cannot read property 'mergeConfig' of undefined".

I'm running latest build of Laravel 5.3.16 along with updated npm -v 3.10.9. Very frustrating spending hours researching this.

fendi_s0709's avatar

I've got same problem. I tried to run

npm install laravel-elixir-webpack-official

and it fixed...

Please or to participate in this conversation.