I'm trying to set up a workflow to run automated cypress tests in GitHub Actions but continue to run into this error message
npm ERR! While resolving: cypress-plugin-snapshots@1.4.4
npm ERR! Found: cypress@8.4.1
npm ERR! node_modules/cypress
npm ERR! dev cypress@"^8.4.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer cypress@"^4.5.0" from cypress-plugin-snapshots@1.4.4
npm ERR! node_modules/cypress-plugin-snapshots
npm ERR! dev cypress-plugin-snapshots@"1.4.4" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: cypress@4.12.1
npm ERR! node_modules/cypress
npm ERR! peer cypress@"^4.5.0" from cypress-plugin-snapshots@1.4.4
npm ERR! node_modules/cypress-plugin-snapshots
npm ERR! dev cypress-plugin-snapshots@"1.4.4" from the root project
I don't have permission to embed images, but here's a screenshot of the entire error message
Relevant section of the YAML workflow:
jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cypress Run
uses: cypress-io/github-action@v4
with:
build: npm run build
start: npm start
spec: cypress/integration/example.js
package.json:
{
"name": "cypressautomations",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"cypress:open": "cypress open",
"cypress:debug": "cross-env CYPRESS_REMOTE_DEBUGGING_PORT=9222 cypress open",
"delete-mochawesome-folder": "rm -f mochawesome-report/*.json",
"e2e_mochawesome": "yarn cypress run --spec cypress/integration/Tests/*.js",
"merge-json": "npx mochawesome-merge --reportDir mochawesome-report > mochawesome1.json",
"html-generator": " npx mochawesome-report-generator mochawesome1.json"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@cypress/snapshot": "2.1.7",
"cross-env": "7.0.3",
"cypress": "^8.4.1",
"cypress-fail-on-console-error": "2.0.6",
"cypress-multi-reporters": "1.4.0",
"cypress-plugin-snapshots": "1.4.4",
"cypress-wait-until": "1.7.1",
"eslint": "7.26.0"
},
"dependencies": {
"@azure/cosmos": "3.10.5",
"bson-ext": "4.0.1",
"dotenv": "8.2.0",
"kerberos": "1.1.7",
"lodash": "4.17.21",
"mocha-junit-reporter": "2.0.0",
"mochawesome": "6.2.2",
"mochawesome-merge": "4.2.0",
"mochawesome-report-generator": "5.2.0",
"mongodb": "4.1.2",
"mongodb-client-encryption": "1.2.7"
},
"peerDependencies": {
"mocha": "3.1.2"
}
}
I tried doing a run with the --legacy-peer-deps flag by adding the following code after the "Checkout" step
- name: Install Dependencies
run: npm ci --legacy-peer-deps
but the error persists. It looks like the 'Cypress Run' action runs the 'npm ci' command as part of its own workflow, even if dependencies are already installed.
Any insight into this problem would be greatly appreciated.