I’m using Debian 9.1.0 and I have installed Node.js by downloading the LTS version Linux Binaries (x64)
.
From the location (where I installed Node.js), I can use it:
$ cd /home/<user>Softwares/nodejs/ $ ./node -v # displays: v6.11.3
But when I run it outside this location, like:
$ cd ~/ $ node -v
I got the error:
bash: node: command not found
The solution I found on Internet: create a symlink
sudo ln -s ~/Softwares/nodejs/ /usr/local/bin/nodejs
doesn’t help me.
Advertisement
Answer
I’m sharing the solution I found based on the comment of Ken Y-N.
I’m missing 2 steps:
Update the PATH
in my .bashrc
using:
$ echo 'export PATH=$PATH:/home/<username>/Softwares/nodejs/bin:$PATH' >> ~/.bashrc
Run make install
$ cd ~/ $ make install