Skip to content

Lesson 5: How the system recognize PRIVATE_KEY_PASSWORD on command line as part of .env if we deleted it? #1591

Discussion options

You must be logged in to vote

Hey, I think you got it wrong process.env does not read the .env file and populates the fields.

The process core module of Node.js provides the env property which hosts all the environment variables that were set at the moment the process was started.

You can set env property while running a particular node file
example : NAME=SHIV node deploy.js this populates process.env.NAME with SHIV

Now, coming to .env file, To populate the variables from this file we have used a package called dotenv and we have configured it at the start of our script. This dotenv is what takes your variables from .env file and add them to process.env .

Conclusion :
You can always set env property without .env fi…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@eli5mecoding
Comment options

Answer selected by eli5mecoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants