【问题标题】:In Terminal EACCES error during the angler cli installation?在垂钓者 cli 安装期间出现终端 EACCES 错误?
【发布时间】:2018-03-03 06:58:37
【问题描述】:

当我尝试使用终端命令安装 angular/cli 时。

之后的“[sudo] nam install -g @angular/cli”

gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '8.9.4' ]
gyp verb install input version string "8.9.4"
gyp verb install installing version: 8.9.4
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.9.4
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.9.4
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.9.4"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp"

你可以看到最后一行警告 EACCES 用户“root”没有权限访问开发目录“/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/ 8.9.4"

之后我使用“ls -la /usr/local/bin”检查了目录

Niteshs-Air:~ niteshwaghmare$ ls -la /usr/local
total 0
drwxr-xr-x  8 root  wheel  256 Mar  2 22:01 .
drwxr-xr-x@ 9 root  wheel  288 Dec  2 01:02 ..
-rw-r--r--  1 root  wheel    0 Mar  1 21:32 .com.apple.installer.keep
drwxr-xr-x  8 root  wheel  256 Mar  3 20:38 bin
drwxr-xr-x  2 root  wheel   64 Mar  2 22:01 etc
drwxr-xr-x  3 root  wheel   96 Jan  3 08:23 include
drwxr-xr-x  4 root  wheel  128 Jan  3 08:23 lib
drwxr-xr-x  5 root  wheel  160 Jan  3 08:23 share

【问题讨论】:

    标签: angular npm-install


    【解决方案1】:

    我遇到了同样的问题。是什么导致这个问题我不知道。由于似乎是权限问题,我暂时更改了/usr/local/lib/node_modules 中@angular 文件夹的权限:

    1. sudo chmod 777 @angular(更改权限以获得更广泛的访问权限)
    2. sudo npm install -g @angular/cli(安装 Angular CLI)
    3. sudo chmod 755 @angular(将权限改回原来的样子)

    这对我有用

    【讨论】:

      猜你喜欢
      • 2017-06-21
      • 2014-04-11
      • 1970-01-01
      • 1970-01-01
      • 2013-09-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-23
      相关资源
      最近更新 更多