Laravel-mix: Fresh install: npm run dev & npm run production fail. npm run watch works

Created on 3 Feb 2017  路  10Comments  路  Source: JeffreyWay/laravel-mix

Any idea on why this is happening on a clean install? All dependencies are up to date.

ERROR  Failed to compile with 5 errors

These dependencies were not found in node_modules:

* ../fonts/bootstrap/glyphicons-halflings-regular.eot
* ../fonts/bootstrap/glyphicons-halflings-regular.woff2
* ../fonts/bootstrap/glyphicons-halflings-regular.woff
* ../fonts/bootstrap/glyphicons-halflings-regular.ttf
* ../fonts/bootstrap/glyphicons-halflings-regular.svg

Did you forget to run npm install --save for them?
            Asset      Size  Chunks                    Chunk Names
       /js/app.js    288 kB       0  [emitted]  [big]  /js/app
mix-manifest.json  32 bytes          [emitted]         

npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/Cellar/node/7.5.0/bin/node" "/usr/local/bin/npm" "run" "production"
npm ERR! node v7.5.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ production: `node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the @ production script 'node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dave/.npm/_logs/2017-02-03T04_57_25_004Z-debug.log

Most helpful comment

I was able to resolve this after reading https://www.npmjs.com/package/bootstrap-sass. It appears bootstrap-sprockets is required. So, here's what's inside in my app.scss.

// Fonts
@import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);

// Variables
@import "variables";

// Bootstrap
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap-sprockets";
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";

All 10 comments

I commented out @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; in resources/assets/sass/app.scss and the errors have stopped. Must be an issue with their package.

nice it works! I've been all night long trying to figure out the same thing with a fresh install too.

Same issue here last night. The problem is I'm using bootstrap at the moment so commeting out is not an option (not a nice one). The path to the fonts seem to be correct while looking at the bootstrap package. Anyone else with an alternative solution?

Steps to reproduce:

1) Clean laravel 5.4 install.
2) Run npm install
3) Run npm run dev

I was able to resolve this after reading https://www.npmjs.com/package/bootstrap-sass. It appears bootstrap-sprockets is required. So, here's what's inside in my app.scss.

// Fonts
@import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);

// Variables
@import "variables";

// Bootstrap
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap-sprockets";
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";

Nice, works :)!

So this has to be updated to app.scss in Laravel itself.

Thanks @mirr !!! That solved the issue 馃憤

I've tried the @mirr 's solution and the errors stops showing.

But the bootstrap fonts doesn't shows up.

And how to use also font-awesome and others fonts like ionicons ?

Is there any workaround to disable the scss-loader to process files like fonts/svg/images when we use url() in our scss files ?

I'm still using gulp in Laravel 5.4 馃槩

thanks @mirr. Works for me as well!

@JeffreyWay Any official resolutions for this issue? It was working fine until v0.6.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sdebacker picture sdebacker  路  3Comments

terion-name picture terion-name  路  3Comments

stefensuhat picture stefensuhat  路  3Comments

dtheb picture dtheb  路  3Comments

hasnatbabur picture hasnatbabur  路  3Comments