If you run the same command again with node_env 11-digit phone number format philippines set to production, you will see that it will remain undefined. Bash copy the code node_env=production node dotenv-example.js the output should now be: bash copy the code no value for foo yet: undefined now the value for foo is: undefined if you don't want to modify your code itself, you can also use -r node's argument to load dotenv when running the script.

Edit your file dotenv-example.js : javascript copy the code console.log('the value for foo is:', process.env.foo); then first run the file normally: bash copy the code node dotenv-example.js the script should report that the current value for foo is undefined. Now run it dotenv: bash copy the code node -r dotenv/config dotenv-example.