R
R
Roman Kalita2016-07-26 00:06:41
JavaScript
Roman Kalita, 2016-07-26 00:06:41

How to set NODE_ENV?

How to correctly set NODE_ENV in the script described in the file package.json?

...
"scripts": {
    "build": "NODE_ENV=production webpack --config ./webpack.prod.config.js --progress --colors",
    "start": "node ./app.js"
  },
...

I try to run it npm run build, but it gives me that
"NODE_ENV" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Yarkov, 2016-07-26
@Engeneer

// Linux
...
"scripts": {
    "build": "export NODE_ENV=production webpack --config ./webpack.prod.config.js --progress --colors",
    "start": "node ./app.js"
  },
...
// Windows
...
"scripts": {
    "build": "set NODE_ENV=production webpack --config ./webpack.prod.config.js --progress --colors",
    "start": "node ./app.js"
  },
...

D
developer, 2017-04-10
@developer

and you didn't forget to do it

npm install

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question