npm list --depth=0)node -v): 6.11npm -v): 4.6 Error on npm run dev:
John Doe [2:42 PM]
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev" "--scripts-prepend-node-path=auto"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `NODE_ENV=development webpack --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_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! 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 ERR! Please include the following file with any support request:
npm ERR! C:\Users\j.doe\IdeaProjects\proj\frontend\src\main\resources\npm-debug.log
I think there's a problem on WIndows with NODE_ENV
npm run dev
Can you do npm install cross-env and update your npm script?
Yes it works with global cross-env, but without is a problem on windows.
It still doesn't work with global cross-env installed.
It works after adding cross-env before each NODE_ENV on the scripts.
Many thanks @crx4 , it's woking for my case :)
Most helpful comment
It works after adding
cross-envbefore eachNODE_ENVon the scripts.