Can't install angular-cli on Mac

前端 未结 12 1044
南笙
南笙 2020-12-28 23:33

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

相关标签:
12条回答
  • 2020-12-29 00:06

    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

    0 讨论(0)
  • 2020-12-29 00:08

    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

    0 讨论(0)
  • 2020-12-29 00:14

    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

    0 讨论(0)
  • 2020-12-29 00:16

    This worked for me.

     sudo npm install --unsafe-perm -g @angular/cli 
    
    0 讨论(0)
  • 2020-12-29 00:18

    For my mac environment

    sudo chown -R $USER /usr/local/lib/node_modules

    running this solve the issue after that just run npm command

    0 讨论(0)
  • 2020-12-29 00:19

    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!

    0 讨论(0)
提交回复
热议问题