Note: You should be a sudoer.

  1. Enter into root user
    $ sudo -s 
  2. Install nvm globally accessible by all the users:
    $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | NVM_DIR=/usr/local/nvm bash
  3. Install node:
    For specific version of node.js
    $ nvm install <version of node>
    eg: nvm install 10.10.0
                ——— OR ———-
    For latest version of node.js
    $ nvm install node
  4. Create a file called nvm.sh in /etc/profile.d with the following contents:
    export NVM_DIR="/usr/local/nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
  5.  Install Angular CLI(Command Line Interface)
    $ npm install -g @angular/cli
  6. Install pm2 (For running on Server. Skip this step if you are doing local setup):
    $ npm install -g pm2

Uninstalling NVM follow the steps

rm -rf ~/.nvm
rm -rf ~/.npm
rm -rf ~/.bower
rm -rf $NVM_DIR ~/.npm ~/.bower