title: /bin/sh: npm: command not found
body: <p>I am creating a docker image for stf.installing nodejs directly using apt-get install nodejs,had many issues.So i decided to go the nvm way.but after installation RUN npm install fails
  I am building the docker image with su username docker build ..</p>
  
  <pre><code>make sure apt is up to date
  RUN apt-get update --fix-missing
  RUN apt-get install -y curl
  RUN sudo apt-get install -y build-essential libssl-dev
  ENV NVM_DIR /usr/local/nvm
  ENV NODE_VERSION 6
  
  # Install nvm with node and npm
  RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | bash \
      &amp;&amp; source $NVM_DIR/nvm.sh \
      &amp;&amp; nvm install $NODE_VERSION \
      &amp;&amp; nvm alias default $NODE_VERSION \
      &amp;&amp; nvm use default
  
  ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
  ENV PATH      $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
  
  #WORKDIR /usr/app
  
  
  # Install app dependencies
  RUN npm install
  </code></pre>
  
  <p>and the output</p>
  
  <pre><code>=&gt; Downloading nvm from git to '/usr/local/nvm'
  =&gt; Cloning into '/usr/local/nvm'...
  * (HEAD detached at v0.30.1)
    master
  
  =&gt; Appending source string to /root/.bashrc
  =&gt; Close and reopen your terminal to start using nvm
  Downloading https://nodejs.org/dist/v6.13.0/node-v6.13.0-linux-x64.tar.xz...
  ######################################################################## 100.0%
  WARNING: checksums are currently disabled for node.js v4.0 and later
  Now using node v6.13.0 (npm v3.10.10)
  default -&gt; 6 (-&gt; v6.13.0)
  Now using node v6.13.0 (npm v3.10.10)
  Removing intermediate container eb9cb6c46f34
   ---&gt; eeef6bf9f0f1
  Step 38/52 : ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
   ---&gt; Running in 185bef8e530c
  Removing intermediate container 185bef8e530c
   ---&gt; 0e5bf7b1cfd9
  Step 39/52 : ENV PATH      $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
   ---&gt; Running in 00d58493e199
  Removing intermediate container 00d58493e199
   ---&gt; 81ed9823020b
  Step 40/52 : RUN npm install
   ---&gt; Running in 1c7577133e24
  /bin/sh: npm: command not found
  The command '/bin/sh -c npm install' returned a non-zero code: 127
  </code></pre>
  
  <p>Please Help.Thanks</p>
  
  <p>Ran the container and checked NPM path</p>
  
  <pre><code>root@69e513b99e68:/home/mobile/MobileFarmDocker#
  
   echo $PATH
  /usr/local/nvm/versions/node/v6.13.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  
  root@69e513b99e68:/home/mobile/MobileFarmDocker# which npm
  /usr/local/nvm/versions/node/v6.13.0/bin/npm
  </code></pre>