process.env.NODE_ENV is undefined
RobertSmith8 opened this issue · 1 comments
RobertSmith8 commented
I have done exactly as in the example but process.env.NODE_ENV is undefined when using npm run development
// process.env.NODE_ENV allows you to get the environment the node process is in
let ver = process.env.NODE_ENV;
I'm on macOS Catalina using Visual Studio
If I run my app like this: NODE_ENV=production node index.js it works
Is it only on macOS Catalina it dosn't work or is it me what are doing some thing wrong?
Camiga commented
Could you try changing:
"development": "set NODE_ENV=development&&npm start"
to:
"development": "NODE_ENV=development npm start"
?
For production, do the same thing but replace both instances of the word development with production.