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.

Exit status 2 on "npm run dev"

See original GitHub issue

Hi,

First of all thanks for laravel-mix. However I can’t get it to work.

My steps:

  1. npm install
  2. Updated node and npm to latest versions
  3. Update laravel-mix to 0.5.1
  4. Updated webpack.mix.js to match the fix branch on the Laravel repo

Every time I run npm run dev I get the below error. Any idea what it could be?

Full stack trace:

npm verb lifecycle @~dev: unsafe-perm in lifecycle true
npm verb lifecycle @~dev: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/bobbybouwmann/OpenSource/vault/node_modules/.bin:/Users/bobbybouwmann/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Users/bobbybouwmann/.composer/vendor/bin
npm verb lifecycle @~dev: CWD: /Users/bobbybouwmann/OpenSource/vault
npm info lifecycle @~dev: Failed to exec dev script
npm verb stack Error: @ dev: `cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm verb stack Exit status 2
npm verb stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at EventEmitter.emit (events.js:191:7)
npm verb stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at ChildProcess.emit (events.js:191:7)
npm verb stack     at maybeClose (internal/child_process.js:885:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm verb pkgid @
npm verb cwd /Users/bobbybouwmann/OpenSource/vault
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev" "--verbose"
npm ERR! node v7.4.0
npm ERR! npm  v4.1.1
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script 'cross-env NODE_ENV=development webpack --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!     cross-env NODE_ENV=development webpack --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 verb exit [ 1, true ]

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/bobbybouwmann/OpenSource/vault/npm-debug.log

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
ngankt2commented, Apr 14, 2017

i try update node, npm to latest

node v7.9.0
npm  v4.2.0

but not working

and then i added babel-preset-es2015 => it working 💃 this command:

npm install --save-dev babel-cli babel-preset-es2015
npm install babel-loader babel-core babel-preset-env webpack --save-dev

I hope, i can help someone!

1reaction
adriaanzoncommented, Jan 23, 2017
npm ERR! node v7.4.0
npm ERR! npm  v4.1.1

😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exit status 2 on "npm run dev" · Issue #127 - GitHub
Hi, First of all thanks for laravel-mix. However I can't get it to work. My steps: npm install Updated node and npm to...
Read more >
Exit status 2 when run webpack prod in jhipster - Stack Overflow
I have a problem when build production with jhipster. Throw error when run webpack prod. I am running on my dev pc.
Read more >
Debugging "Make Failed with Exit Code 2" Error - CodeForGeek
The “Make Failed with Exit Code 2” error occurs during the node modules installation. We see lots of stack trace including the one...
Read more >
Error when running npm install && npm run dev - Laracasts
have a fresh installation of laravel and I've installed npm. but when I run npm install && npm run dev I get this...
Read more >
concurrently - npm
Start using concurrently in your project by running `npm i ... must exit with code 0 in order for concurrently exit with code...
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