davidxd33's avatar

Elixir error when running webpack

On a fresh laravel 5.3 install I tried running gulp after an npm install but was greeted with the following error once webpack started to run:

David@PERSONAL ~/Code/php/islandclash (master)
$ gulp
[12:27:50] Using gulpfile c:\Users\David\Code\php\islandclash\gulpfile.js
[12:27:50] Starting 'all'...
[12:27:50] Starting 'sass'...
[12:28:01] Finished 'sass' after 11 s
[12:28:01] Starting 'webpack'...
c:\Users\David\Code\php\islandclash\node_modules\laravel-elixir-webpack-offi
cial\node_modules\webpack\node_modules\loader-runner\lib\loadLoader.js:35
                        throw new Error("Module '" + loader.path + "' is not
 a loader (must have normal or pitch function)");
                        ^

Error: Module 'c:\Users\David\Code\php\islandclash\node_modules\buble\dist\b
uble.umd.js' is not a loader (must have normal or pitch function)
    at loadLoader (c:\Users\David\Code\php\islandclash\node_modules\laravel-
elixir-webpack-official\node_modules\webpack\node_modules\loader-runner\lib\
loadLoader.js:35:10)
    at iteratePitchingLoaders (c:\Users\David\Code\php\islandclash\node_modu
les\laravel-elixir-webpack-official\node_modules\webpack\node_modules\loader
-runner\lib\LoaderRunner.js:140:2)
    at runLoaders (c:\Users\David\Code\php\islandclash\node_modules\laravel-
elixir-webpack-official\node_modules\webpack\node_modules\loader-runner\lib\
LoaderRunner.js:326:2)
    at NormalModule.doBuild (c:\Users\David\Code\php\islandclash\node_module
s\laravel-elixir-webpack-official\node_modules\webpack\lib\NormalModule.js:1
25:2)
    at NormalModule.build (c:\Users\David\Code\php\islandclash\node_modules\
laravel-elixir-webpack-official\node_modules\webpack\lib\NormalModule.js:173
:15)
    at Compilation.buildModule (c:\Users\David\Code\php\islandclash\node_mod
ules\laravel-elixir-webpack-official\node_modules\webpack\lib\Compilation.js
:127:9)
    at Compilation.<anonymous> (c:\Users\David\Code\php\islandclash\node_mod
ules\laravel-elixir-webpack-official\node_modules\webpack\lib\Compilation.js
:401:8)
    at c:\Users\David\Code\php\islandclash\node_modules\laravel-elixir-webpa
ck-official\node_modules\webpack\lib\NormalModuleFactory.js:63:13
    at NormalModuleFactory.applyPluginsAsyncWaterfall (c:\Users\David\Code\p
hp\islandclash\node_modules\laravel-elixir-webpack-official\node_modules\web
pack\node_modules\tapable\lib\Tapable.js:123:70)
    at onDoneResolving (c:\Users\David\Code\php\islandclash\node_modules\lar
avel-elixir-webpack-official\node_modules\webpack\lib\NormalModuleFactory.js
:38:11)
0 likes
9 replies
nate.a.johnson's avatar

Are you running node 6+ and npm 3+? I've had issues running orders versions of node and npm.

nate.a.johnson's avatar

If you can upgrade, you might try that. I've had problems trying to run elixir 6, which is what laravel 5.3 uses, with your versions of node/npm.

nate.a.johnson's avatar
Level 8

Sorry, this is hard to debug not having the project in front of me. I'd blow away node_modules now that you have upgraded and re-run:

npm install

kuroi's avatar

As Nate says, difficult to debug without the project in front of you, but I had similar (though not identical) and fixed it by ensuring that I had sass and the sass loader installed:

npm install --save-dev sass sass-loader

1 like
dorvidas's avatar

Everytime I need to run npm install I wonder what errors I will get. It is really a headache. So my setup that I got working:

  • Windows 10
  • Node v6.6.0 (when downloading select "current" to get latest/greatest and not LTS, because if so you get 4.5.0)
  • npm v3.10.8 (npm install -g npm@latest)
  • Laravel 5.3.10
  • Although I use Homestead I run all commands on host/windows machine

So if you have this run:

  • npm install --no-bin-links (Maximum call stack size exceeeded)
  • npm install --no-bin-links (not errors some warnings. Love consistency...)
  • gulp (get error - Error: ENOENT: no such file or directory, scandir 'D:\www\laravel_playground\node_modules\node-sass\vendor')
  • npm install node-sass --no-bin-links
  • gulp (worked!!!!)

Lets see if Laravel v5.2.38 project still works with current node/npm versions. Coming from v4.5/v2.15.10 where it was ok:

  • npm install --no-bin-links (delete node_modules content. Got Maximum call stack size exceeded)
  • npm install --no-bin-links (running again was fine)
  • gulp (!worked)
1 like

Please or to participate in this conversation.