title: Why can't nodejs be found?
body: <p>I'm trying to install some software on my server via SSH, but for some reason node.js can't be found. I type:</p>
  
  <pre><code>    './public_html/server/Start-linux.sh'
  </code></pre>
  
  <p>Into the command line which references an install script file, whose code is:</p>
  
  <pre><code> #!/bin/bash
  
  ##Function Definition
  pause() {
  read -p "Press [Enter] key to exit"
  }
  
  
  cd $(dirname $0) # cd scr dir
  if [ ! "$(id -u)" = 0 ] &amp;&amp; [ ! -f ".readwarning" ]; then
      echo "WARNING: Ogar uses priveleged ports by default, which may" \
          "cause an error. Please either change the ports in the config" \
          "file (gameserver.ini) to two different ports above 1024, or run" \
          "this script as root. This warning will only be shown once, unless" \
          "the file \".readwarning\" is deleted" 1&gt;&amp;2
      touch .readwarning
      sleep 5
  fi
  
  #Check which command to execute, nodejs (debian based) or node (others)
  #This will give priority to nodejs
  command -v nodejs &amp;&gt;/dev/null
  if [ $? -eq 0 ]; then
  nodejs index.js
  else
  command -v nodejs &amp;&gt;/dev/null
  
  if [ $? -eq 0 ]; then
      node index.js
  else
       nodejs index.js echo "Couldn't find nodejs. Please install it and ensure       it is in your \$PATH"
  fi
  fi
  
  # Pause
  #pause
  </code></pre>
  
  <p>I then get an error message:"Couldn't find nodejs. Please install it and ensure it is in your $PATH".</p>
  
  <p>When I type 'node -v' in the command line it returns 'v4.4.2', so clearly it's there. Why the heck is it saying it's not found? Also what is $PATH? How do I ensure nodejs is in my $path?</p>
  
  <p>I'm a beginner with SSH and node.js so any help would be appreciated. I'm in a linux centos 64bit system.</p>