【发布时间】:2019-03-03 18:16:42
【问题描述】:
我不知道发生了什么。我正在编码......然后一切都崩溃了。
当我运行 ng build 或 ng serve 时,我现在收到以下错误消息:
./node_modules/saucelabs/index.js 中的错误模块未找到:错误: 无法解析 './lib-cov/SauceLabs' '/Users/mlgyshan/Documents/GitHub/Nutanix2/FlexMachineLearning/FlexMachineLearning/static/node_modules/saucelabs' ./node_modules/protractor/built/runner.js 中的错误 ...
我跑了npm i,它给出了以下输出:
npm WARN codelyzer@3.2.2 需要 @angular/compiler@^2.3.1 的同级 || >=4.0.0-beta =4.0.0-beta =2.4.2
在 9.015 秒内审计了 29419 个包,发现了 58 个漏洞(19 个低,28 个 中等,11 高)运行
npm audit fix来修复它们,或者npm audit了解详情
【问题讨论】:
-
在尝试
ng serve之前,您是否npm i?因为看到的错误就像您缺少很多依赖项一样。 -
是的。我在上面的问题中添加了输出。
-
删除
node_modules并再次运行npm i怎么样? -
@askYous 如果删除/安装 node_modules,您可能处于依赖地狱中,您的 package.json 中的库版本冲突
-
我在删除
node_modules并运行npm i时收到了同样的错误。我发现当我撤消我的更改(在 git 上)时,错误消失了。我会检查一下。
标签: angular angular-cli