2

I am a beginner in Node and I see the following code in my project:

process.env.NODE_ENV

What is NODE_ENV and how can I get access to it or change it? It seems to pick up some values but don't know from where is it getting picked up.

Please let me know.

3
  • 1
    Check your operating system's environment variables Commented Jun 9, 2016 at 14:37
  • 1
    See stackoverflow.com/a/9204973 for ways NODE_ENV can be set Commented Jun 9, 2016 at 14:56
  • Possible duplicate of What is NODE_ENV in Express? Commented Jun 9, 2016 at 14:58

1 Answer 1

4

NODE_ENV is the name of an environment variable, and you can access and change it in your shell Ex: export NODE_ENV=development , you can change it when running your process, Ex: NODE_ENV=production node application.js, or you can change it in one of your shell's configuration files.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.