title: Using environment variables from ~/.bashrc in "npm start"?
body: <p>Sorry if this is a duplicate. I tried to find a similar question but couldn't. Here's the breakdown:</p>
  
  <p>I need to use a secret key with a package I'm building and I don't want to publish it so I'm trying to set it as a local bash environment variable. In my .bashrc file I have this:</p>
  
  <pre><code># Obviously this is not the REAL key, just an example
  MY_KEY="1111111111111111"
  </code></pre>
  
  <p>And then in my Gulpfile, I have a task called "dev". For simplicity sake, let's say it looks like this:</p>
  
  <pre><code>gulp.task('dev', function () {
    console.log(process.env.SECRET_KEY);
  });
  </code></pre>
  
  <p>Then, in order to get the secret key into the environment, I have the following in my package.json:</p>
  
  <pre><code>"scripts": {
    "start": "SECRET_KEY=$MY_KEY gulp dev"
  }
  </code></pre>
  
  <p>So the problem is, when I run the command <code>npm start</code>, my gulp task logs <code>undefined</code> for the secret key. But when I manually run the command <code>SECRET_KEY=$MY_KEY gulp dev</code>, the gulp task logs <code>1111111111111111</code>. So, for some reason, <code>npm start</code> is not correctly accessing my bash variable and passing it into the Node environment. Is there a way to make this work?</p>