title: Layman's explanation of environment variables and OS shells
body: <p>Web development is new to me and I'm trying to grasp the meaning and usage of environment variables once and for all. In my research the most simple explanation I've come across is that it is comparable to 'configuration settings'.</p>
  
  <p>Through the terminal I've been exploring what feels like the computer's innards by typing <code>printenv</code> <em>etc etc.</em></p>
  
  <p>But I'm still not sure when it is necessary to set up env var. For example, I use <code>fish</code> as my shell. Often when I try to do an <code>npm install</code> it seems like the package didn't take. Here is a recent example:</p>
  
  <pre><code>user@iMac-van-user ~/P/v/v/public_html&gt; npm install -g modernizr
  /usr/local/Cellar/node/10.4.0/bin/modernizr -&gt; /usr/local/Cellar/node/10.4.0/lib/node_modules/modernizr/bin/modernizr
  + modernizr@3.6.0
  updated 1 package in 2.316s
  user@iMac-van-user ~/P/v/v/public_html&gt; modernizr
  </code></pre>
  
  <p>When I try to use <code>modernizr</code> as a command <code>fish</code> will tell me the <code>modernizr</code> is an unknown command and the color remains red. Valid commands show up in white in fish. Thus I have a suspicion that <code>modernizr</code> will only be available and valid once I've set up the configs. I've had this happen many times with various attempts to install package managers and things like <code>composer</code>, <code>vue-cli</code>, etc. My failures to get it working boils down to my meager knowledge of environment variables and what they do, I think.</p>
  
  <p>This is from the documentation on the <code>modernizr</code> site: <code>modernizr -c modernizr-config.json</code></p>
  
  <blockquote>
    <p>Note that you will need to give the command line config the file path
    to the configuration you downloaded from the site. In the above
    example, we are running the modernizr command from the same folder
    that we downloaded the modernizr-config.json file to.</p>
  </blockquote>
  
  <p>What does the sentence: <em>"Note that you will need to give the command line config the file path to the configuration you downloaded from the site"</em> imply?  I copied the file into my project folder but there is no change.</p>
  
  <p>Is there is someone that can explain the following to me in layman's terms, so like you would to a 5 year old, it would be great:</p>
  
  <ol>
  <li>use of environment variables</li>
  <li>setting up configs - why, where and how (I've done it once through VIM)</li>
  <li>how to know when to set up environment variables</li>
  </ol>
  
  <p>Thank you in advance.
  Developing on macOS 10.</p>