npm throws EACCES error on installation of Angular CLI

后端 未结 9 604
没有蜡笔的小新
没有蜡笔的小新 2020-12-11 15:34

I am unable to install Angular Cli globally through npm. I keep getting this error when I run npm install -g @angular/cli on macOS:

npm ERR! nod         


        
9条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-11 16:10

    Hello Please Follow my guide to install angular 4 from the cli without any permission issues:

    Install the angular-cli globally

    sudo npm install -g @angular/cli
    

    Create a new project

    ng new my-app --skip-install
    

    Serve the application

    sudo chown  -R my-app
    cd my-app
    mkdir node_modules
    chmod a+w node_modules
    npm install
    ng serve --open
    

提交回复
热议问题