You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用npm安装Angular CLI遇警告且ng命令无法识别的解决方法

解决Angular CLI安装警告及ng命令无法识别问题

安装Angular CLI时出现如下警告:

npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs

同时系统无法识别ng命令,可按以下步骤解决:

  1. 确认Node.js已安装并正常运行
    执行以下命令,验证是否能正常返回对应版本号:

    node -v
    npm -v
    
  2. 全局安装TypeScript
    运行命令:

    npm install -g typescript
    
  3. 重新安装Angular CLI
    执行命令:

    npm install -g @angular/cli
    
  4. 若上述步骤无效,执行以下操作

    • 彻底卸载Node.js及相关模块后重新安装,确保环境变量路径配置正确
    • 以管理员身份打开Windows PowerShell,执行命令允许系统运行脚本:
      Set-ExecutionPolicy -ExecutionPolicy Unrestricted
      

    完成后再次运行Angular CLI相关命令即可。

内容的提问来源于stack exchange,提问作者Ronit Malhotra

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.31 10:10:26