【问题标题】:Not able to install angular无法安装角度
【发布时间】:2018-08-11 14:04:44
【问题描述】:

我无法安装 angula,我尝试使用 clear npm cache npm cache clean --force。但仍然无法安装。请帮我 enter image description here

我正在使用节点版本 - 8.11.3 Npm 版本 - 6.1.0

【问题讨论】:

  • 请检查屏幕短
  • 确保 c:\Users\com\AppData\Roaming\npm 在您的 PATH 中,然后重新启动命令行。将命令和输出作为文本发布,而不是作为图像链接。

标签: angular-cli


【解决方案1】:

添加一个名为 NODE_PATH 的环境变量并将其设置为 %USERPROFILE%\Application Data\npm\node_modules (Windows XP)、%AppData%\npm\node_modules (Windows 7/8/10),或者 npm 最终在您的 Windows 风格上安装模块的任何位置。要一劳永逸地完成它,请将其添加为“系统属性”对话框的“高级”选项卡中的系统变量(运行control.exe sysdm.cpl,System,3)。

Windows 7+ 中的快速解决方案是直接运行:

rem for future
setx NODE_PATH %AppData%\npm\node_modules
rem for current session
set NODE_PATH=%AppData%\npm\node_modules

值得一提的是,NODE_PATH 仅在 Node 应用程序中导入模块时使用。当您想在 CLI 中使用全局安装模块的二进制文件时,您还需要将其添加到您的 PATH,但没有 node_modules 部分(例如 Windows 7/8/10 中的 %AppData%\npm)。

Original answer

【讨论】:

    【解决方案2】:

    请确保环境变量已配置如下,

    C:\Users\user\AppData\Roaming\npm\node_modules\angular-cli\bin;
    

    关闭 cmd 并重新打开一次。

    【讨论】:

      猜你喜欢
      • 2021-03-20
      • 2022-01-27
      • 1970-01-01
      • 1970-01-01
      • 2021-04-03
      • 2018-07-26
      • 1970-01-01
      • 1970-01-01
      • 2020-10-02
      相关资源
      最近更新 更多