When I set my scripts to:
"start": "NODE_ENV=development nodemon dist/Server.js"
, I am encountering an issue when trying to access NODE_ENV
in my code. Both dot and bracket notation return undefined
:
The dependencies in my project are: "@types/node": "^8.0.53" "typescript": "^2.6.1" node 8.9.1 installed locally
Even after console.logging it, it seems like process.env.NODE_ENV
is not even present.
console.log(process.env.NODE_ENV);
console.log(process.env["NODE_ENV"]);
as suggested
here
What could be the issue here?