title: How to set node path for nodejs (Ubuntu)
body: <p>I'm trying to setup nodejs to access a postgres database. What I've done so far is the following (https://gist.github.com/579814): </p>
  
  <pre><code>echo 'export PATH=$HOME/local/bin:$PATH' &gt;&gt; ~/.bashrc
  . ~/.bashrc
  mkdir ~/local
  mkdir ~/node-latest-install
  cd ~/node-latest-install
  curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
  ./configure --prefix=~/local
  make install # ok, fine, this step probably takes more than 30 seconds...
  curl http://npmjs.org/install.sh | sh
  </code></pre>
  
  <p>then</p>
  
  <pre><code>git clone git://github.com/isaacs/npm.git
  make
  make install
  </code></pre>
  
  <p>so far, so good. However, when I try to install the postgres driver </p>
  
  <pre><code>npm install pg
  </code></pre>
  
  <p>I get the following: </p>
  
  <blockquote>
    <p>node-waf configure build || true</p>
  </blockquote>
  
  <pre><code>Checking for program g++ or c++          : /usr/bin/g++ 
  Checking for program cpp                 : /usr/bin/cpp 
  Checking for program ar                  : /usr/bin/ar 
  Checking for program ranlib              : /usr/bin/ranlib 
  Checking for g++                         : ok  
  Checking for node path                   : not found 
  Checking for node prefix                 : ok /usr/local 
  Checking for program pg_config           : /usr/bin/pg_config 
  'configure' finished successfully (0.066s)
  Waf: Entering directory `/home/christian/node_modules/pg/build'
  [1/2] cxx: src/binding.cc -&gt; build/default/src/binding_1.o
  ../src/binding.cc:3:25: fatal error: node_events.h: No such file or directory
  compilation terminated.
  Waf: Leaving directory `/home/christian/node_modules/pg/build'
  Build failed:  -&gt; task failed (err #1): 
      {task: cxx binding.cc -&gt; binding_1.o}
  </code></pre>
  
  <p>I've been looking around for setting the node path, although haven't found anything of help so far - probably also because I'm totally new to nodejs, so I'd be happy about any hint. </p>