[英]process.env.NODE_ENV not being read correctly by express js
Even though I have set: 即使我已设置:
export NODE_ENV=production
in .bashrc
file which is not getting overwritten by any other file, 在
.bashrc
文件中,该文件不会被任何其他文件覆盖,
The value of process.env.NODE_ENV
inside app.js is undefined whereas value of app.get('env')
is development. app.js中的
process.env.NODE_ENV
的值是未定义的,而app.get('env')
是开发的。
Again, I am able to print the value of NODE_ENV correctly to console by using: echo $NODE_ENV
which returns production. 同样,我可以使用以下命令正确打印NODE_ENV的值以进行控制台:
echo $NODE_ENV
返回生产。
What am I doing wrong? 我究竟做错了什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.