node.js process.env.NODE_ENV 无法判断问题?
大家讲道理
大家讲道理 2017-04-17 15:28:39
0
3
582
大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(3)
刘奇

Thanks for the invitation production Do not leave spaces

"start": "set NODE_ENV=production&& npm run build && node babel/server",

Just look at the output

console.log(`+${env}+`, env === "production");
迷茫
declare -x NODE_ENV=production && node temp.js

Passed the test myself

If it does not pass, use typeof env to print out the type and have a look. It may be object

刘奇

Change the set in the command to export

export NODE_ENV=production

You used the set command to bring spaces into environment variables

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template