cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.04k stars 1.09k forks source link

Error: Cannot find module 'cucumber' #2289

Closed Schepetkov closed 1 year ago

Schepetkov commented 1 year ago

Precondition: Windows:

Edition Windows 11 Home
Version 22H2
Installed on    ‎10/‎16/‎2022
OS build    22621.1702
Experience  Windows Feature Experience Pack 1000.22641.1000.0

VS Code:

Version: 1.78.2 (user setup)
Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435
Date: 2023-05-10T14:39:26.248Z
Electron: 22.5.2
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: No

Reproduction steps:

  1. create a new folder
  2. open this folder via VS code
  3. run command npm install --save-dev @cucumber/cucumber
  4. run command cucumber-js --version

Actual behavior: Error: Cannot find module 'cucumber'

Expected behavior: display current version in my case: @cucumber/cucumber": "^9.1.2

image

PS: Is this a bug? Or I'm doing something wrong?

davidjgoss commented 1 year ago

From the output there it looks like you might have the old “cucumber” module installed, maybe globally?

Can you try removing that?

michael-lloyd-morris commented 1 year ago

I've personally never been able to get cucumber-js to invoke that way in Windows PowerShell. When I try I get a different error than OP - specifically the global installed warning even though that is entirely erroneous. Further the script works just fine if invoked through npm test

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 3 weeks with no activity. Remove the stale label or comment or this will be closed in another 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 5 days with no activity.