Cypress runs in VSCode terminal but not in WSL2

Viewed 17

I can run cypress in VSCode terminal - I'm using the remote WSL2 connection. When I try to run it directly from WSL2 I get the following error.

I thought that the bash terminal in VSCode and in WSL is an identical environment, so I'm baffled as to why this happens.

Error: Cannot find module 'electron'
Require stack:
- /home/jiri/.cache/Cypress/10.4.0/Cypress/resources/app/packages/server/lib/makeDataContext.js
- /home/jiri/.cache/Cypress/10.4.0/Cypress/resources/app/packages/server/lib/modes/index.js
- /home/jiri/.cache/Cypress/10.4.0/Cypress/resources/app/packages/server/lib/cypress.js
- /home/jiri/.cache/Cypress/10.4.0/Cypress/resources/app/packages/server/index.js
- /home/jiri/.cache/Cypress/10.4.0/Cypress/resources/app/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
    at Module._load (node:internal/modules/cjs/loader:785:27) 
0 Answers
Related