خرید بک لینک

Vote count: 0

I have a node.js app. It runs in the "production" mode when it was launched by the npm start and in the 'development' mode when it was launched by node start.js. I don't understand the difference.

How can I set the 'development' mode according the system variable also for the 'npm start'?

Inside the script I log the value of the NODE_ENV this way:

console.log(process.env.NODE_ENV)

My system variable:

d:>echo %NODE_ENV%
development

My NPN content:

...
"private": true,
"main": "start.js",
"scripts": {
  "start": "node --use_strict start.js",
...

The problem:

  • when I run node --use_strict start.js - retus: "development" (right)
  • when I run npm start - retus production (wrong)

(win: 7, npm: 3.8.3, node: v5.10.1)

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 20 ارديبهشت 1395 ساعت: 19:58

صفحه بندی