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.

11.0.0 `cypress run` -> `Error: Cannot find module 'mocha-7.0.1'`

See original GitHub issue

Current behavior

When I upgraded to 11.0.0, I ran cypress run as usual, and I got an error Error: Cannot find module 'mocha-7.0.1'

Desired behavior

No response

Test code to reproduce

const { defineConfig } = require(‘cypress’)

module.exports = defineConfig({ reporter: ‘mochawesome’, reporterOptions: { reportDir: ‘cypress/results’, overwrite: false, html: false, json: true } })

Cypress Version

11.0.0

Node version

v16.18.0

Operating System

macOS 13.0

Debug Logs

[1] Error loading the reporter: mochawesome
[1] 
[1] We searched for the reporter in these paths:
[1] 
[1]  - /Users/xxx/project/mochawesome
[1]  - /Users/xxx/project/node_modules/mochawesome
[1] 
[1] Learn more at https://on.cypress.io/reporters
[1] 
[1] Error: Cannot find module 'mocha-7.0.1'
[1] Require stack:
[1] - /Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/server/lib/reporter.js
[1]     at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
[1]     at n._resolveFilename (node:electron/js2c/browser_init:249:1105)
[1]     at PackherdModuleLoader._tryResolveFilename (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/packherd-require/dist/loader.js:645:32)
[1]     at PackherdModuleLoader._resolvePaths (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/packherd-require/dist/loader.js:491:31)
[1]     at PackherdModuleLoader.tryResolve (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/packherd-require/dist/loader.js:313:40)
[1]     at resolve (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/packherd-require/dist/require.js:125:33)
[1]     at require.resolve (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/v8-snapshot-require/dist/snapshot-require.js:216:28)
[1]     at customRequire.resolve (<embedded>:2809:961257)
[1]     at <embedded>:2755:13102
[1]     at i._load (<embedded>:2750:54101)
[1]     at Module.require (node:internal/modules/cjs/loader:1012:19)
[1]     at require (node:internal/modules/cjs/helpers:102:18)
[1]     at Object.<anonymous> (/Users/xxx/project/node_modules/.pnpm/mochawesome@7.1.3_mocha@10.1.0/node_modules/mochawesome/src/mochawesome.js:1:14)
[1]     at Module._compile (node:internal/modules/cjs/loader:1120:14)
[1]     at Module._extensions..js (node:internal/modules/cjs/loader:1175:10)
[1]     at Module.load (node:internal/modules/cjs/loader:988:32)
[1]     at Module._load (node:internal/modules/cjs/loader:829:12)
[1]     at c._load [as origLoad] (node:electron/js2c/asar_bundle:5:13339)
[1]     at PackherdModuleLoader.tryLoad (/Users/xxx/Library/Caches/Cypress/11.0.0/Cypress.app/Contents/Resources/app/packages/packherd-require/dist/loader.js:432:30)
[1]     at customRequire (<embedded>:2809:960157)
[1]     at S.loadReporter (<embedded>:2755:19452)
[1]     at P.initializeReporter (<embedded>:2802:336581)
[1]     at P.startWebsockets (<embedded>:2802:336891)
[1]     at P.open (<embedded>:2802:335033)
[1]     at async v.create (<embedded>:2802:347432)
[1]     at async O (<embedded>:2802:421364)
[1]     at async W (<embedded>:2802:432780)

Other

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:14
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

12reactions
mjhenkescommented, Nov 10, 2022

Released in 11.0.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v11.0.1, please open a new issue.

8reactions
emilyrohrboughcommented, Nov 9, 2022

We are actively investigating the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

11.0.0 `cypress run` -> `Error: Cannot find module 'mocha-7.0.1'`
Fast, easy and reliable testing for anything that runs in a browser. - 11.0.0 `cypress run` -> `Error: Cannot find module 'mocha-7.0.1'` ...
Read more >
0 - Stack Overflow
Using Cypress, getting "warn mocha-intellij: cannot load "./lib/utils". Caused by Error: Cannot find module 'mocha'" · The stack trace you ...
Read more >
Reporters | Cypress Documentation
Because Cypress is built on top of Mocha, that means any reporter built for Mocha can be used with Cypress. Here is a...
Read more >
cypress-io/cypress - Gitter
Hi, I'm trying to use a different mocha reporter (e.g. "dot") to have a much simpler stdout output, but it appears like cypress...
Read more >
Discussion of Using Mochawesome Reporter with Cypress
Anyone who is stuck with the npm error post ** cypress run ** can follow the above links. ... The system cannot find...
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