AshHeskes AshHeskes - 1 year ago 79
Node.js Question

Error installing NPM for node.js

I'm trying to install

on ubuntu 11.04 using the "git all the way" method found in this gist

I keep getting this error after running
sudo make install

$ sudo make install
! [ -d .git ] || git submodule update --init --recursive
node cli.js install -g -f
bash: node: command not found
make: *** [install] Error 127

I know this is something wrong with
, but I'm not very good with bash.


running the
command in the terminal brings up the
as expected

Answer Source

Your problem is that when you sudo, you are not sourcing the same bashrc file (or whatever is setting your PATH and/or NODE_PATH), and so the system cannot find node.

I would guess that sudo node won't work.

You need to export your NODE_PATH as @Ken suggested, WHILE SUDOING:

sudo PATH=/path/to/node/bin/dir:$PATH make install

EDIT: to use PATH as worked in comments below

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download