npm install angular/cli 不起作用 - 似乎卡在中途,没有日志,没有关于卡住原因的错误

问题描述 投票:0回答:1

任何人都可以帮我解决 npm install @angular/cli 期间遇到的问题吗

详情如下

我正在运行的命令:

npm install -g @angular/cli

我所看到的:安装开始拉一些包,然后卡在一个点上,我等了几个小时才完成,但在那之后它再也没有做任何事情。这就是它被卡住的地方(当使用
--verbose
运行上面的命令时得到这个)

npm stuck image

我尝试过的替代方案:

@angular/cli@latest

@angular/cli@specificversion(16/15 etc.)

restarted machine

uninstalled/reinstalled node

checked PATH variable is there

Run the command as administrator, in powershell, nodejs command prompt, windows command prompt, VS Code terminal, but gets stuck at this point everywhere

我也尝试在

npm cache clean --force

之后运行它
node.js angular npm angular-cli
1个回答
0
投票

我自己解决了这个问题。

将其发布在这里,作为将来可能遇到此问题的任何人的答案。

我必须使用记事本打开 .npmrc 文件,并更新设置为默认 npm 注册表 URL 的 URL。 URL 设置为

http://registry.npmjs.org
,我将其更改为
https://registry.npmjs.org

© www.soinside.com 2019 - 2024. All rights reserved.