This post documents the steps to install nodejs on a Linux system using console (terminal) commands.
Download nodejs (here I’m downloading the recommended version) which can be found on the nodejs website.
#> wget https://nodejs.org/dist/v8.9.4/node-v8.9.4-linux-x64.tar.xz
Extract the files from the tar archive and place in /usr/local
.
#> tar -xf node-v8.9.4-linux-x64.tar.xz #> mv node-v8.9.4-linux-x64 /usr/local
Now create links to the nodejs binaries in /usr/local/bin
.
#> ln -s /usr/local/node-v8.9.4-linux-x64/bin/* /usr/local/bin/
Node should now be installed on your system.
#> node -v v8.9.4
If you don’t see the version string output when issuing the above command, you probably need to put /usr/local/bin
into your path – on Ubuntu 16.04, I did not.
In your default shell, add the following lines to the configuration file (in Bash, ~/.bashrc
or ~/.bash_profile
).
PATH=$PATH:/usr/local/bin export PATH