question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sudden "npm run dev" error after update to 0.8.3 (0.8.1 still works)

See original GitHub issue
  • Laravel Mix Version: 0.8.3
  • Node Version (node -v): 7.6.0
  • NPM Version (npm -v): 4.2.0
  • OS: MacOS Sierra

Description:

After updating laravel-mix to 0.8.3 I suddenly get an error on “npm run dev”.

Steps To Reproduce:

  • I ran “npm update”
  • Only laravel-mix updated itself from 0.8.1 to 0.8.3
  • Type “npm run dev”
  • Error!
  • Set laravel-mix version to 0.8.2 + npm update + npm run dev
  • Still error!
  • Set laravel-mix version to 0.8.1 + npm update + npm run dev
  • Phew it works again.

CMD output:

@ dev /Users/thom/Sites/vacatures 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

module.js:472 throw err; ^

Error: Cannot find module ‘/Users/thom/Sites/vacatures/node_modules/cross-env/bin/cross-env.js’ at Function.Module._resolveFilename (module.js:470:15) at Function.Module._load (module.js:418:25) at Module.runMain (module.js:605:10) at run (bootstrap_node.js:422:7) at startup (bootstrap_node.js:143:9) at bootstrap_node.js:537:3

npm ERR! Darwin 16.4.0 npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” “dev” npm ERR! node v7.6.0 npm ERR! npm v4.2.0 npm ERR! code ELIFECYCLE npm ERR! errno 1 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/thom/.npm/_logs/2017-02-22T22_06_58_870Z-debug.log 2017-02-22T22_06_58_870Z-debug.log.txt

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:9
  • Comments:38 (6 by maintainers)

github_iconTop GitHub Comments

13reactions
turzaizsoltcommented, Mar 4, 2017

For me the quick solution was this

  "scripts": {
    "dev": "node node_modules/cross-env/dist/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",
    "watch": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "node node_modules/cross-env/dist/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"
  }
6reactions
ThomHurkscommented, Feb 22, 2017

Okay, updating the package.json to the new version in Laravel’s master branch does indeed fix the problem I have.

Running npm run dev works now, but it does produce a deprecation warning, just so you know: “DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56 parseQuery() will be replaced with getOptions() in the next major version of loader-utils.”

Not sure if I should close this issue, because probably many others who type “npm update” will get this problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sudden "npm run dev" error after update to 0.8.3 (0.8.1 still ...
Set laravel-mix version to 0.8.1 + npm update + npm run dev; Phew it works again. CMD output: @ dev /Users/thom/Sites ...
Read more >
Why I can not run Npm run dev? - Stack Overflow
Basically delete the node_modules folder and package-lock.json file , clear cache and do an npm install. Worked for me.
Read more >
Meteor Changelog | Meteor API Docs
The meteor shell command now works when running meteor test . The meteor debug command no longer pauses at the first statement in...
Read more >
node-sass - npm
Start using node-sass in your project by running `npm i node-sass`. There are 12489 other projects in the npm registry using node-sass.
Read more >
Bug listing with status CONFIRMED as at 2022/12/26 10:46:31
Bug:4315 - "[Future EAPI] add support for version ranges in DEPEND" status:CONFIRMED resolution: severity:enhancement · Bug:10735 - "sys-apps/portage or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found