Laravel-mix: npm run broken since 0.8.0

Created on 15 Feb 2017  路  6Comments  路  Source: JeffreyWay/laravel-mix

Hi there,

and thanks for you amazing work.

  • Laravel Mix Version: 0.8.0
  • Node Version (node -v): v7.4.0
  • NPM Version (npm -v): 4.3.0
  • OS: Mac Sierra

Description:

Since upgrading to 0.8.0 (was working with 0.7) I can not run npm run hot anymore

> @ hot /Users/rd/Web/code
> node_modules/cross-env/bin/cross-env.js NODE_ENV=development webpack-dev-server --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js

module.js:472
    throw err;
    ^

Error: Cannot find module 'autoprefixer'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/rd/Web/code/node_modules/laravel-mix/setup/webpack.config.js:101:21)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at requireConfig (/Users/rd/Web/code/node_modules/webpack/bin/convert-argv.js:96:18)
    at /Users/rd/Web/code/node_modules/webpack/bin/convert-argv.js:109:17
    at Array.forEach (native)
    at module.exports (/Users/rd/Web/code/node_modules/webpack/bin/convert-argv.js:107:15)

npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "hot"
npm ERR! node v7.4.0
npm ERR! npm  v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ hot: `node_modules/cross-env/bin/cross-env.js NODE_ENV=development webpack-dev-server --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ hot script 'node_modules/cross-env/bin/cross-env.js NODE_ENV=development webpack-dev-server --inline --hot --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_modules/cross-env/bin/cross-env.js NODE_ENV=development webpack-dev-server --inline --hot --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/rd/.npm/_logs/2017-02-15T19_38_27_428Z-debug.log

Most helpful comment

Running npm install autoprefixer fixes it, but it really shouldn't be broken out of the box.

All 6 comments

It is not just hot that breaks. I get exactly the same error when I run npm run dev.

Can confirm npm run dev is broken since 0.8.0.

Running npm install autoprefixer fixes it, but it really shouldn't be broken out of the box.

Yep. Can confirm that npm install autoprefixer solves the problem :-)

It looks like downgrading the css-loader version requirement causes the autoprefixer package to be absent?

The older css-loader requires an older version of cssnano, which in turn doesn't require the autoprefixer yet. I guess it should be added to the Laravel-Mix package.json, though.

Hmm - weird that I never saw this error.

Anyways, I've just tagged 0.8.1 that adds autoprefixer as a dependency. Thanks guys!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stefensuhat picture stefensuhat  路  3Comments

sdebacker picture sdebacker  路  3Comments

mementoneli picture mementoneli  路  3Comments

Cheddam picture Cheddam  路  3Comments

Bomavi picture Bomavi  路  3Comments