title: Node and NPM path in OSX
body: <p>I have a very strange configuration issue.</p>
  <p>When logging to machine (SSH session) and executing the following commands using interactive shell, they succeed:</p>
  <pre><code>node --version
  npm --v
  </code></pre>
  <p>However, when I execute the following through script from remote machine:</p>
  <pre><code>#!/bin/bash
  
  #Script input arguments
  user=${1} 
  server=${2} 
  
  #Tell the shell to quote your variables to be eval-safe!
  printf -v user_q '%q' &quot;$user&quot;
  printf -v server_q '%q' &quot;$server&quot;
  #
  
  # Script variables
  address=&quot;$user_q&quot;@&quot;$server_q&quot;
  #
  
  function run {
      ssh &quot;$address&quot; /bin/bash &quot;$@&quot;
  }
  
  
  run &lt;&lt; SSHCONNECTION
  
  node --version
  npm --v
  
   exit
  SSHCONNECTION
  </code></pre>
  <p>I get the following output:</p>
  <blockquote>
  <p>/bin/bash: line 2: node: command not found</p>
  <p>/bin/bash: line 3: npm: command not found</p>
  </blockquote>
  <p>I am conscious that the issue may be the in .bash_profile file configuration</p>
  <pre><code>export PATH=&quot;/usr/local/bin/npm:/usr/local/bin/node:/usr/local/bin:$PATH&quot;
  </code></pre>
  <p>Also, here is result of <code>npm config get prefix</code>:</p>
  <blockquote>
  <p>/usr/local</p>
  </blockquote>
  <p>Can you please suggest what I am doing wrong?</p>