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.

Laravel Mix npm run dev error

See original GitHub issue
  • Laravel Mix Version: 1.4.2 (npm list --depth=0)
  • Node Version (node -v): v8.2.1
  • NPM Version (npm -v): 5.3.0
  • OS: Debian 8

Description:

When I’m running the command npm run dev, I’m getting the following output with an error:

root@gra2-status:/var/www/webinterface# npm run dev

> @ dev /var/www/webinterface
> npm run development


> @ development /var/www/webinterface
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: spawn node_modules/webpack/bin/webpack.js ENOENT
    at exports._errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
    at onErrorNT (internal/child_process.js:374:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:607:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env 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 @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-07-29T07_18_17_185Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-07-29T07_18_17_205Z-debug.log

Steps To Reproduce:

Clean Laravel Installation ( composer create-project laravel/laravel webinterface)

  1. run: composer install
  2. run: npm install
  3. run: npm run dev

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:178
  • Comments:123 (1 by maintainers)

github_iconTop GitHub Comments

1564reactions
JeffreyWaycommented, Aug 1, 2017

I just followed those steps, and everything worked correctly. Try doing a full reset:

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
166reactions
fulopattila122commented, Oct 19, 2017

These javascript tools tend to remind me to good old Windows:

  • are present everywhere
  • everybody uses them
  • they cannot be avoided
  • they throw seemingly random errors
  • no one knows the real cause of the errors
  • reset resolves them.

🎢

Read more comments on GitHub >

github_iconTop Results From Across the Web

In laravel npm run dev errors: - Stack Overflow
Solution that worked for me : I had unstalled npm which was installed globally and reinstalled the same globally and "npm run dev"...
Read more >
npm run dev error - Laracasts
It seems that friendly-errors-webpack-plugin isnt loaded.. Is this a very old laravel project or something? It should be in node_modules/laravel-mix/package.
Read more >
npm run dev issue (npm ERR! code ELIFECYCLE) - scmGalaxy
Step 2:- Recheck your package.json and webpack.mix.js file it is correct or not. Step 3:- Then Delete the Node Module file which is...
Read more >
npm run dev is showing error on existing Laravel Project
npm run dev is showing error on existing Laravel Project ... Hello, I did everything described here: https://preview.keenthemes.com/html/metronic/docs/getting- ...
Read more >
Compiling Assets (Mix) - The PHP Framework For Web Artisans
Before running Mix, you must first ensure that Node.js and NPM are ... When you run the dev or production scripts, all of...
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