Deadlock condition

Installing NodeJS, NPM, Angular-CLI on Ubuntu 16.04 with the less headache

First we will install the latest NodeJS, the best way to make it easy and correct is to use NVM - Node Version Manager
To minimize chances of permissions errors, you can configure npm to use a different directory. In this example, it will be a hidden directory on your home folder.
Install nvm:
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
$ bash install_nvm.sh
  1. Make a directory for global installations:
mkdir ~/.npm-global
  1. Configure npm to use the new directory path:
npm config set prefix '~/.npm-global'
  1. Open or create a ~/.profile file and add this line:
export PATH=~/.npm-global/bin:$PATH
  1. Back on the command line, update your system variables:
source ~/.profile
Test: Download Angular-CLI globally without using sudo.
npm i @angular/cli

Comments