cucumber / docs

Cucumber user documentation
https://cucumber.io/docs/installation/
MIT License
151 stars 529 forks source link

Step of installing cucumber as dependency should be required for the 10 Minute Tutorial #927

Closed salimdellali closed 2 weeks ago

salimdellali commented 1 year ago

👓 What did you see?

Error: Cannot find module 'cucumber'
Require stack:
- /path-to-cucumber-10-mn-tutorial/cucumber-js-tutorial/features/steps_definition/stepsdefs.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/path-to-cucumber-10-mn-tutorial/cucumber-js-tutorial/features/steps_definition/stepsdefs.js:2:31)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)

✅ What did you expect to see?

0 scenarios
0 steps
0m00.000s (executing steps: 0m00.000s)

📦 Which tool/library version are you using?

@cucumber/cucumber version 10.0.0
node version 18.15.0
npm version 9.5.0

🔬 How could we reproduce it?

following the tutorial 10 Minute Tutorial, the project works fine until you create the file is_it_friday_yet.feature, after you have created the file, and run npm test or npx cucumber-js, the error is thrown

📚 Any additional context?

to fix the problem, install cucumber as a dependency by running npm install cucumber, so the step of installing cucumber as a dependency should occur right before creating the file is_it_friday_yet.js, and needs to be mentioned in the tutorial


This text was originally generated from a template, then edited by hand. You can modify the template here.

luke-hill commented 2 weeks ago

Hi @salimdellali - Are you able to submit a PR to the docs. You should find the edit button on each relevant page.

salimdellali commented 2 weeks ago

@luke-hill the moment I get some free time I will do it, hope I won't forget. Feel free to re-ping me here if I did not create a PR in the short term future lol

salimdellali commented 2 weeks ago

@luke-hill after checking again the 10 Minute Tutorial (JS), I see that the missing step of installing the cucumber.js package was added.

closing this issue as it has been resolved.