【问题标题】:Unable to install angular/cli, ng issue [duplicate]无法安装角度/cli,ng问题[重复]
【发布时间】:2021-04-03 17:59:04
【问题描述】:

有人可以帮我吗?

我无法安装 Angular,我不明白我的错误:

> C:\Users\alear>npm i -g @angular/cli
>     npm WARN deprecated debug@4.2.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1.
> (https://github.com/visionmedia/debug/issues/797)
>     npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
>     npm WARN deprecated har-validator@5.1.5: this library is no longer supported
>     C:\Users\alear\AppData\Roaming\npm\ng -> C:\Users\alear\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
>     
>     > @angular/cli@11.0.5 postinstall C:\Users\alear\AppData\Roaming\npm\node_modules\@angular\cli
>     > node ./bin/postinstall/script.js
>     
>     + @angular/cli@11.0.5
>     updated 1 package in 21.528s
>     
>     C:\Users\alear>ng new my-app
>     'ng' is not recognized as an internal or external command,
>     operable program or batch file.

【问题讨论】:

  • 大家好,我终于找到了错误,令人难以置信,但在某些情况下,我的用户不同,所以......我只是格式化我的笔记本电脑,所以我猜一个可以正确解决的问题

标签: angular


【解决方案1】:

这应该可行。

首先更新Node.js的版本。我发现10.23.0 版本效果最好。我建议下载那个。安装该版本并尝试运行npm i -g @angular/cli。这应该可以帮助您解决问题。

https://nodejs.org/en/blog/release/v10.23.0/

为您的平台下载安装程序并重新运行 npm 命令以安装 Angular 并查看是否有效。

【讨论】:

  • 嗨拉金杜!我当前的节点版本是 v14.15.3,npm 是 6.14.9
  • 尝试切换到 10.23,看看它是否对您有帮助。我发现 10.23 在角度方面对我来说更好
猜你喜欢
  • 2021-03-20
  • 2019-12-12
  • 2020-04-23
  • 1970-01-01
  • 2021-10-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多