Reputation: 294
I can't install the framework Angular on my Mac.
Mac version:
macOS Mojave version 10.14.6
The terminal suggest I should be using an admin account to make this installation work.
This is what I have been using to the terminal for the install:
npm install -g @angular/cli
This is the error displayed, copying and pasting the code is not comprehensive so instead I made the snapshot.
Upvotes: 0
Views: 187
Reputation: 294
I was able to install angular using brew. Use this link to find more about how to install Brew on your macOS, and about Angular while using brew the details are here. You only need to run brew install angular-cli
I think on the terminal, so I hope that works out for anyone else having issues regarding this frameworks installation.
Upvotes: 0
Reputation: 1
Try logging in as a super user.
sudo npm install -g @angular/cli
Hope it works!
Upvotes: 0
Reputation: 3571
This problem is well known on macOS machines, and is linked to how your OS protects certain directories. Here is the procedure recommended in the NPM docs:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
~/.profile
file and add this line:
export PATH=~/.npm-global/bin:$PATH
source ~/.profile
Alternatively, you can install NodeJS and NPM using a version manager like nvm
. With both of these methods, you are simply creating and defining a new directory where all of your NPM stuff will be installed. This prevents you from having to use sudo
to install packages.
Upvotes: 2