This is probably very trivial, but I am hitting my head against the wall while I am trying to (unsuccessfully) install angular-cli.
I am following the official angul
Error: EACCES: permission denied, rmdir '/Users/mkotsollaris/.npm-packages/lib/node_modules/.staging/@angular'
you do not have permissions to access the directories node_modules.
your process want to make changes to your directories and it is not allowed to access you can easily be in super user (admin), have access permission is thrown the command so that the processur can modify the node_modules angular.
sudo npm install -g @angular/cli
To get rid of access errors, these steps can help:
Step1: Homebrew installation[https://brew.sh/]: (on terminal)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Step2: brew install node
Check version: node -v, npm -v
Step3: brew install -g angular-cli
Check version: ng --version
Step4: ng new First-App
After going back and forth i used homebrew. Just run: "sudo brew install angular-cli" If you have homebrew installed, it solved all my problems including node-sass issues on angular 7
This worked for me.
sudo npm install --unsafe-perm -g @angular/cli
For my mac environment
sudo chown -R $USER /usr/local/lib/node_modules
running this solve the issue after that just run npm command
I've faced a problem very similar to this one before. It's most likely that you installed Node & NPM as root etc.
You should attempt to re-install Node & NPM without sudo
, one of these scripts might work for you: https://gist.github.com/isaacs/579814
Then retry npm i -g angular-cli
and hopefully should work no problems.
Best of luck!