question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot find module 'test/cypress/support/step_definitions/shared.js'

See original GitHub issue

I’m getting this error:

Error: Cannot find module 'test/cypress/support/step_definitions/shared.js' from '/Users/ashtoc03/Sites/bbc/news-vj-search-lookup/features'

…on v1.2.2 of cypress-cucumber-preprocessor, when v1.0.0 was working ok (removed package-lock.json and it stopped working).

This is our cypress config:

{
    "fileServerFolder": "test/cypress",
    "fixturesFolder": "test/cypress/fixtures",
    "integrationFolder": "features",
    "supportFile":  "test/cypress/support/index.js",
    "pluginsFile": "test/cypress/plugins/index.js",
    "videosFolder": "test/cypress/videos",
    "screenshotsFolder": "test/cypress/screenshots",
    "video": false
}

And here is our dir structure:

screen shot 2018-07-31 at 16 13 43

Could be that there’s been an API change and we’re doing something wrong, or it could be that this is a regression… (looks similar to #30)?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lgandeckicommented, Aug 2, 2018

As I thought:

putting this:

  "cypress-cucumber-preprocessor": {
    "step_definitions": "test/cypress/support/step_definitions"
  }

in your package.json fixes the problem.

I’m thinking whether I should try to make it work for the mistakenly used “fileServerFolder”: “test/cypress”, as well, or just make a note in the documentation that this is no longer supported (it was deprecated a few versions back)

0reactions
lgandeckicommented, Aug 15, 2018

cypress.json is for cypress configuration, and you are not configuring cypress here, really. If you don’t want to pollute package.json you have all the options that https://github.com/davidtheclark/cosmiconfig gives you

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I resolve "Cannot find module" error using Node.js?
Using npm install installs the module into the current directory only (in a subdirectory called node_modules ). Is app.js located under ...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
The module (package) not found is always specified in the format "Module not found: Error: Can't resolve 'package name' in 'project directory".
Read more >
[Solution] Error: Cannot Find Module "nodemailer" - Courier
This error occurs when you have not installed the nodemailer library in your Node.js application. Solution - Here's How To Resolve It. First,...
Read more >
Error: Cannot find module in JavaScript [SOLVED]
We can solve Error: Cannot find module by installing the missing module. We can use npm tool to install the mising module.
Read more >
How to resolve "Cannot find module" error in Node - Sabe.io
To fix the Cannot find module error, simply install the missing modules using npm . To so, you can use the following command:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found