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

安装@angular/cli@14.2.5遇npm错误,重装Node.js无效求解决

解决npm安装@angular/cli@14.2.5时的"Cannot read properties of null (reading 'edgesOut')"错误

错误详情

执行全局安装命令时触发错误:

C:\FATIH\angular_text>npm i -g @angular/cli@14.2.5
npm error Cannot read properties of null (reading 'edgesOut')
npm error A complete log of this run can be found in: C:\Users\FATİH\AppData\Local\npm-cache\_logs\2024-08-04T22_46_12_043Z-debug-0.log

已尝试卸载重装Node.js,问题仍未解决,需完成安装并能通过npm list查看已安装包。


解决方案

  • 强制清理npm缓存
    先执行命令清理缓存:

    npm cache clean --force
    

    再手动删除缓存目录:C:\Users\FATİH\AppData\Local\npm-cache

  • 匹配兼容的npm版本
    Angular CLI 14.2.5与npm 6.x/8.x兼容性更好,建议通过Node版本管理器(nvm)切换到Node.js 16.x(默认配套npm 8.x),再重新执行安装命令:

    npm i -g @angular/cli@14.2.5
    
  • 以管理员权限运行命令行
    右键打开命令提示符/PowerShell,选择「以管理员身份运行」,再执行安装命令,规避权限引发的缓存异常。

  • 重置npm配置
    执行以下命令重置默认配置,排除代理或镜像源问题:

    npm config delete proxy
    npm config delete https-proxy
    npm config set registry https://registry.npmjs.org/
    

验证安装

完成后执行以下命令确认:

ng version
npm list -g --depth=0

内容的提问来源于stack exchange,提问作者Fatih Güneş

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.20 04:24:59