运行Angular项目时出现Cannot read properties of undefined (reading 'Minus')错误
Angular项目运行报错:Cannot read properties of undefined (reading 'Minus')
问题详情
启动项目时触发未处理异常:
error: An unhandled exception occurred: Cannot read properties of undefined (reading 'Minus') See "C:\Users\DEVELO~1\AppData\Local\Temp\ng-t4Itqs\angular-errors.log" for further details.
可行解决步骤
- 清理依赖缓存与重装:
执行npm cache clean --force清除npm缓存,删除项目根目录下的node_modules文件夹、package-lock.json文件,再运行npm install重新安装依赖 - 对齐Angular CLI版本:
用ng version查看全局CLI版本与项目本地版本,若不一致,执行npm install @angular/cli@项目对应版本 --save-dev安装匹配的本地CLI版本 - 排查第三方依赖问题:
该错误多与图标库、UI组件库的导入/配置错误相关,检查是否存在未正确导入的Minus图标,或依赖版本不兼容的情况,尝试升级/降级对应依赖包 - 定位精准报错点:
打开提示路径中的angular-errors.log文件,查看详细堆栈信息,找到报错的具体文件和代码行,针对性修复问题
内容的提问来源于stack exchange,提问作者josmi joseph
相关产品推荐
相关产品推荐

