title: nodejs .env variable undefined
body: <p>I am getting undefined when trying to get the value from .env</p>
  
  <p>Here is my server.js </p>
  
  <pre><code> console.log(process.env.val);
  </code></pre>
  
  <p>Here is my .env file</p>
  
  <pre><code> val=hello
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/S1kzC.png" rel="nofollow noreferrer">Screenshot that shows the file hierarchy</a></p>
  
  <p>When I run the server I get undefined. How to fix? </p>