node.js - npm install -g @angular/cli 在 Windows 7 中不起作用并挂起

标签 node.js angular npm angular-cli npm-install

我无法从 npm 安装 Angular cli,并且它在要求 loadAllDepsIntoIdealTree 时卡住了。

采取的步骤:

C:\Windows\system32\node -v

v6.11.1

C:\Windows\system32\npm -v

2010年10月3日

C:\Windows\system32\npm install -g @angular/cli

它被附加的错误卡住了

enter image description here

最佳答案

我也遇到了同样的问题。以下解决方案对我有用。

如果你升级你的node会更好和npm版本到最新。之后请按照以下步骤安装angular/cli :

使用管理权限打开命令提示符并卸载 angular/cli通过使用npm uninstall -g angular-cli命令。

删除node_modules目录,然后使用 npm cache clear --force 清除缓存命令。

删除C:\Users\<username>\AppData\Roaming\npm\C:\Users\<username>\AppData\Roaming\npm-cache .

尝试安装angular/cli@latest通过使用npm install -g @angular/cli@latest命令。

希望以上技巧能解决您的问题。

关于node.js - npm install -g @angular/cli 在 Windows 7 中不起作用并挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45325567/

相关文章:

npm - 如何仅使用 package.json 同时运行 watchify、browser-sync 和自动浏览器刷新

node.js - 尝试更新帐单信息时获取 "The caller does not have permission"

json - 我如何构建消息以使用 node.js 通过 TCP 发送?

angular - 资源 URL 上下文中使用的不安全值 Angular 错误

c++ - 安装时如何使NodeJS软件包生成C++/WebAssembly?

node.js - 尝试 npm install bower 时在命令行旋转光标

node.js - 使用 ng 服务找不到模块 "@angular-devkit/build-angular"

node.js - Nodejs + Express + OpenId 连接并重定向到 root

javascript - Angular 通用获取错误 : You must pass in a NgModule or NgModuleFactory to be bootstrapped

javascript - 如何在 Angular 6 中处理多个 http 请求