title: How to run npm through ssh
body: <p>After installing npm according to <a href="https://nodesource.com/blog/installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu/" rel="nofollow noreferrer">https://nodesource.com/blog/installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu/</a> , 3 lines were added at the end of <code>~/.bashrc</code> to load nvm tools.</p>
  
  <p>When connecting to that server with ssh, <code>npm --version</code> outputs <code>5.5.1</code> as expected.</p>
  
  <p>But when running remotely :</p>
  
  <pre><code>ssh server /bin/bash -l -c "npm --version"
  </code></pre>
  
  <p>I get :</p>
  
  <blockquote>
    <p>--version: npm: command not found</p>
  </blockquote>
  
  <p>What is the correct way to have npm available when running it remotely in one line?</p>