Skip to content

When installing Node and NPM, it is best to download the node package rather than from your OS distribution source. For mac and linux, it is fairly straight forward yet window might be slightly easier.

1) download the LTS node v10.x.x binary node*.tar.xz file from https://nodejs.org/en/download/

2) sudo mkdir /opt/node
3) cd $HOME/Download/
4) tar xJvf node-10.16.0-linux-x64.tar.xz
5) cd node-10.16.0-linux-x64
6) sudo cp -pr . /opt/node
*7) sudo chown -R username:username /opt/node
8) cd /opt/node/bin
8.5) cd /usr/local/bin; sudo ln -s /opt/node/bin/node node
9) ./npm install -g npm
10) If you are on linux use .bashrc file otherwise on mac try .profile
vim $HOME/.bashrc
insert the following items inside this file:
NODEJS=/opt/node
export PATH=$PATH:$NODEJS/bin
:wq (save data and quit the vim editor)
11) source .bashrc
12) npm -v
13) Now we have this latest npm package application, we can now installed any of the JS Framework as we pleased.
14) cd; mkdir nodeware
15) cd nodeware
16) npm install @angular/cli
17) npm install -g vue
18) npm install -g react

*we are using ubuntu 18.04.2 LTS at the moment and our user account could very well be different from your user account, so bare in mind that you should adjust your chown user accordingly. Also, to prevent root being use excessively in /opt, we 've decided that we would be using our own user account instead. You can easily create a simple nodejs user account and only have access to that /opt/node directory for this special software. There are other ways to remedy this ownership of this directory besides this approach.