0

While trying to run cypress test from saucectl (saucelab) I am getting "Error: Cannot find module 'pdf-parse'". Not sure how to resolve this issue as my test works fine while running locally. Let me know if anyone has any solution for this.

index.js file path: \cypress\plugins\index.js pdf require detail: const pdfparser = require("pdf-parse");

2 Answers 2

1

This means that you have a dependency in your tests that is not installed on the Sauce Labs VM. Please check all dependencies you use in your tests and add them to you config yaml-file as described here

It would look something like this

npm:
  packages:
    pdf-parse: "1.1.1"
Sign up to request clarification or add additional context in comments.

Comments

0

I think you missed to install the npm dependency,

npm i pdf-parse

1 Comment

+@Pali solution from @wswebcreation worked for me. The error was from saucectl side as I have not added dependency in config.yml file.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.