Resolving Yarn2 + Cypress GitHub Action: Cannot find module ‘cypress’

Charles Stover
2 min readOct 23, 2021

An open issue exists for running the end-to-end test GitHub Action in a Yarn2 plug-and-play repository: the action fails with the following error:

Error: Cannot find module 'cypress'
Require stack:
- /home/runner/work/_actions/cypress-io/github-action/v2/dist/index.js

I dug into resolving this myself, and I found the root cause to be this line of the GitHub Action:

// If `command:` is provided, run it.
const customCommand = core.getInput('command')…