【问题标题】:Error installing angular/cli using terminal使用终端安装 angular/cli 时出错
【发布时间】:2017-10-31 06:44:57
【问题描述】:

我正在尝试安装 angular/cli,当我在终端中运行 npm install -g @angular/cli 时出现这些错误消息

npm ERR! Darwin 16.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "@angular/cli"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/katherine/npm-debug.log

有谁知道我该如何解决这个问题,以及问题是什么?

【问题讨论】:

    标签: angular npm terminal


    【解决方案1】:

    您缺少管理员权限。

    如果你在 linux 上运行

    试试

    sudo npm install -g @angular/cli
    

    如果它在 Windows 上尝试以 administrator

    身份运行命令控制台

    【讨论】:

      【解决方案2】:

      尝试使用 sudo

      sudo npm install -g @angular/cli

      【讨论】:

        猜你喜欢
        • 2018-11-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-02
        • 1970-01-01
        • 2020-03-09
        • 2020-12-19
        • 2023-03-29
        相关资源
        最近更新 更多