You have to change version for your desired version (11, 10, 8 or 6)
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - $ sudo apt-get install -y nodejsBefore we go ahead and install Angular we should configure a folder for global packages this is taken from John Papa blog :
$ mkdir ~/.npm-packages
$ sudo npm config set prefix ~/.npm-packages
Now we can install Angular or any other Npm packet without sudo:$ npm install -g @angular/cliYou'll need to edit the PATH variable of your session for ng command you will use come from ~/.npm-packages:
nano ~/.profile
export PATH=~/.npm-packages/bin:$PATH
If the above doesn't work, check out this link : https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
No comments:
Post a Comment