【发布时间】:2018-06-12 02:47:52
【问题描述】:
我似乎无法安装 Angular CLI(来自 the Angular tutorial)。我对命令行不是很熟悉,所以请耐心告诉我需要提供哪些信息。
Screenshot of the error in the Terminal window
我尝试以 root/Administrator 身份安装,但我得到了同样的错误。我正在我的个人 MacBook Air 笔记本电脑上安装。
编辑:我也尝试过从命令行强制和 sudo 安装,但无济于事。
编辑(2):根据评论者的建议,我已经测试了node和npm的版本:
-
node -v导致v8.11.2 -
npm -v导致5.6.0 -
npm i -g @angular/cli typescript导致以下错误:npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
编辑(4):
下面是终端输入以下命令后的截图:
sudo npm install -g @angular/cli
Error after sudo install of @angular/cli
编辑(5): 输入以下命令后的截图:
sudo chown -R kailynnelson /usr/local/lib/node_modules
sudo npm install -g @angular/cli
【问题讨论】:
标签: angular macos terminal npm-install