error in doing npm run dev


(Chiranjibi) #1

npm ERR! code ELIFECYCLE
npm ERR! errno 2
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 2
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! C:\Users\LONOVO\AppData\Roaming\npm-cache_logs\2019-02-18T16_27_37_768Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: npm run development
npm ERR! Exit status 2
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! C:\Users\LONOVO\AppData\Roaming\npm-cache_logs\2019-02-18T16_27_37_973Z-debug.log


(John Gee) #2

Looks like the command which failed was webpack (or cross-env).

You can run the command quoted in the log directly yourself which is often handy to reduce the number of extra messages and try one thing at a time. e.g. to run just the webpack part

NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

(Chiranjibi) #3

watch this video


(John Gee) #4

When you type npm run <name> it runs that named script from the scripts in package.json. The difference between the scripts before and after the copy/paste in the video was putting the cross-env on the front (which set NODE_ENV to development), and changing the value for --config.

I donโ€™t know what the right --config is for your project. This might be a question to ask in a laravel forum, as I donโ€™t think the problem is with npm itself.


(system) closed #5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.