【问题标题】:ng build spills a lot of errors... can't launch my appng build 溢出很多错误...无法启动我的应用程序
【发布时间】: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


【解决方案1】:

我知道发生了什么。我有这条线:

import { EventEmitter } from "protractor";

但我不得不把它改成这样:

import { EventEmitter } from "@angular/core";

【讨论】:

  • 我从“量角器”中删除了 import { Key } 并修复了
  • 谢谢!我浪费了几个小时来搜索这个问题。
猜你喜欢
  • 2021-05-10
  • 1970-01-01
  • 1970-01-01
  • 2017-10-09
  • 2020-01-03
  • 1970-01-01
  • 2013-10-27
  • 2013-11-20
  • 2020-09-08
相关资源
最近更新 更多