node and sudo: now kiss

Published on

Getting permission errors when installing a module?

Are ‘sudo: node: command not found’ errors taking away your precious sleeping hours?

Remove any trace of node on your system, and reinstall it. It will suit your pain:

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local && ~/node-latest-install && ~/node-latest-install
curl | tar xz --strip-components=1
./configure --prefix=~/local && make install
curl | sh
rm -rf ~/node-latest-install

adapted from here

Your one/two steps/commands away from success. Just replace /path/to/your/home/ with the absolute path to your home directory (leaving the rest of the path as is):

sudo ln -s / /usr/local/bin/
sudo ln -s / /usr/local/bin/
now kiss