0

I'm trying to run testing on my project when running e2e on Azure

The error I'm getting in "ng e2e" is: Error: Cannot find module './app-automate' The commands executed are:

npm install -g protractor
cd [project]
npm install
npm run webdriver-manager-update
npm run e2e

Thank you very much for your help.

oana
  • 83
  • 1
  • 10
  • According to what you're saying, angular is looking for a module within the same directory contained within a file named `app-automate.ts`, maybe is complaining because the module is not present? or is within a different directory? or is in the root? or it doesn't exist?. – Bargros Jun 08 '20 at 13:31
  • This module doesn't exist and I don't understand why is asking for it, because on my local, it works perfectly and it doesn't have this module – oana Jun 08 '20 at 13:55
  • Is this in the pipeline? might be a bad merge? post a full error log, that way me and others can have more transparency – Bargros Jun 08 '20 at 14:08
  • Yes, it is happening in pipelines, while I am running the agent job. Unfortunately, I can't post the full error log, because it seems it is too big for the code section. – oana Jun 08 '20 at 15:11
  • Did you check the version of the code being build in the pipeline? it sounds like a bad merge tho – Bargros Jun 08 '20 at 15:17
  • on master, I have just a template app, where I installed protractor. The template app is hosted on IIS – oana Jun 08 '20 at 16:09
  • Thats not what I mean, what Im trying to say is that what you have locally and whats being build on the pipeline might be different, even thought the branch might be the same, these things could happen, happened to me several times due to a bad merge. – Bargros Jun 08 '20 at 17:18
  • I finally solved the issue. I had to remove node from the build server and reinstall it because the version was deprecated (https://stackoverflow.com/questions/20711240/how-to-completely-remove-node-js-from-windows/20711410#20711410) and also I had to remove the target folder, which contains the results of ng e2e and was missed by .gitignored while merging. And also, I had to change the path of the project on azure(https://stackoverflow.com/questions/55233309/azure-devops-npm-please-change-your-working-directory-to-a-valid-directory/55234287) Thank you, guys, for your help – oana Jun 10 '20 at 15:12

1 Answers1

0

Problem: The 'node_modules/browserstack/lib' directory has app-automate.js file missing. You can check it manually. The solution: Re-install the browserstack module again i.e. npm install browserstack