I use webpack 3.1.0, node 9.2.0, command line of windows 10.
Got the error when I run script on package.json.
"scripts": {
"build": "NODE_ENV=production webpack --progress --colors -p",
...
}
I get the errors like below.
13 verbose stack Error: wow_dns@1.0.0 build: `NODE_ENV=production webpack --progress --colors -p`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\sheng\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack at EventEmitter.emit (events.js:159:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\sheng\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:159:13)
13 verbose stack at maybeClose (internal/child_process.js:943:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid wow_dns@1.0.0
15 verbose cwd F:\wow\wow_dns
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\sheng\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
But it would be run through, if I delete "NODE_ENV=production" like:
"scripts": {
"build": "webpack --progress --colors -p",
...
}
It will works. How to setting running environment in with production environment?