4

I don't know what happened. I was coding... then everything just broke.

When I run ng build or ng serve, I now get the following error messages:

ERROR in ./node_modules/saucelabs/index.js Module not found: Error: Can't resolve './lib-cov/SauceLabs' in '/Users/mlgyshan/Documents/GitHub/Nutanix2/FlexMachineLearning/FlexMachineLearning/static/node_modules/saucelabs' ERROR in ./node_modules/protractor/built/runner.js ...


I ran npm i and it gave the following output:

npm WARN [email protected] requires a peer of @angular/compiler@^2.3.1 || >=4.0.0-beta <5.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of @angular/core@^2.3.1 || >=4.0.0-beta <5.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of typescript@>=2.4.2 <2.9 but none is installed. You must install peer dependencies yourself.

audited 29419 packages in 9.015s found 58 vulnerabilities (19 low, 28 moderate, 11 high) run npm audit fix to fix them, or npm audit for details

7
  • did you npm i before trying ng serve? Because the errors seens like you are missing a lot of dependencies. Sep 27, 2018 at 19:13
  • Yes. I added the output to my question above.
    – AskYous
    Sep 27, 2018 at 19:16
  • How about deleting node_modules and running npm i again? Sep 27, 2018 at 19:31
  • @askYous if removing/installing node_modules you might be in dependency hell, where you conflicting library versions in your package.json
    – rhavelka
    Sep 27, 2018 at 19:37
  • I received the same error when removing node_modules and running npm i. I found out that when I undo my changes (on git), the error disappears. I'll check that out.
    – AskYous
    Sep 27, 2018 at 19:41

1 Answer 1

25

I found out what happened. I had this line:

import { EventEmitter } from "protractor";

But I had to change it to this:

import { EventEmitter } from "@angular/core";
2
  • I removed import { Key } from 'protractor' and it fixed Aug 1, 2019 at 13:38
  • 2
    Thank you! I lost some hours searching this problem. Jan 9, 2020 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.