Error: Cannot find module 'test/cypress/support/step_definitions/shared.js'
See original GitHub issueI’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:
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:
- Created 5 years ago
- Comments:10 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As I thought:
putting this:
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)
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