laravel-mix: npm run dev fails on fresh 5.4 install

I encountered this on a fresh 5.4 install.

Jordans-MacBook-Pro:Mix jordandalton$ npm run dev

> @ dev /Users/jordandalton/Code/Projects/Mix
> node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

/Users/jordandalton/Code/Projects/Mix/node_modules/laravel-mix/setup/webpack.config.js:120
        let extractPlugin = new plugins.ExtractTextPlugin(
        ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:54:16)
    at Module._compile (module.js:375:25)
    at Object.Module._extensions..js (module.js:406:10)
    at Module.load (module.js:345:32)
    at Function.Module._load (module.js:302:12)
    at Module.require (module.js:355:17)
    at require (internal/module.js:13:17)
    at requireConfig (/Users/jordandalton/Code/Projects/Mix/node_modules/webpack/bin/convert-argv.js:96:18)
    at /Users/jordandalton/Code/Projects/Mix/node_modules/webpack/bin/convert-argv.js:109:17
    at Array.forEach (native)

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v5.2.0
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ dev script 'node node_modules/cross-env/bin/cross-env.js NODE_ENV=development 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=development 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/jordandalton/Code/Projects/Mix/npm-debug.log

So I tried updating laravel-mix to 0.5.9 but no luck. Also updated node and npm to latest versions…no luck as well.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17

Most upvoted comments

@AttaUrRehman24 100%? no absolutely not

Upgrade Node.

I hade a problem with sass compile and try reinstalling node-sass, it worked for me. npm install node-sass

Im having the same problem, tried everything mentioned above upgraded node/npm as well no success so far.

I added

“babel”: { “presets”: [ “es2015” ] }

To pacakge.json and it fixed everything.

On Feb 10, 2017, at 8:49 AM, Daniel White <notifications@github.commailto:notifications@github.com> wrote:

Same and Node 7.5.0

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/JeffreyWay/laravel-mix/issues/227#issuecomment-278996764, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ARN49i2h0p2BV1ewm6Z-Lp7QEG-WlaTRks5rbJUigaJpZM4Lw6ha.