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.

[BUG] NPM7 Fails to install: unmet peer dependency with Cypress 5+ - "could not resolve dependency"

See original GitHub issue

What tool(s) are you using?

  • accessibility-checker-engine
  • accessibility-checker
  • karma-accessibility-checker
  • rule-server
  • boilerplates
  • other - cypress-accessibility-checker

Detailed description

Node version: 16.5.0 NPM version: 7.19.1 Platform: MacOS

Due to changes in NPMs package lock (lockfileversion 2), an error is thrown on npm i when using any version of Cypress that is not explicitly called out as a peer dependency of the cypress-accessibility-checker package.

Steps to reproduce the issue

  1. install the latest version of node
  2. add cypress to your package as a dev dependency (we are on v8.3.0)
  3. add cypress-accessibility-checker as a dev dependency (we are on v3.1.9)
  4. run npm install

Additional information

  • our project’s package.json:
    "devDependencies": {
        "@babel/core": "7.14.6",
        "@cypress/webpack-preprocessor": "5.9.1",
        "@mural/ds-manifest-builder": "0.0.0",
        "@storybook/addon-a11y": "6.3.4",
        "@storybook/addon-actions": "6.3.4",
        "@storybook/addon-essentials": "6.3.4",
        "@storybook/addon-links": "6.3.4",
        "@storybook/html": "6.3.4",
        "@storybook/react": "6.3.4",
        "@types/fs-extra": "9.0.12",
        "babel-loader": "8.2.2",
        "cypress": "8.2.0",
        "cypress-accessibility-checker": "3.1.9",
        "rimraf": "3.0.2",
        "ts-loader": "8.3.0"
    },
    "dependencies": {
        "@mural/ds-component-button": "0.0.0",
        "@mural/component-starter": "0.0.0",
        "@mural/ds-config": "0.0.0"
    }
    
  • error output in terminal:
    npm ERR! Found: cypress@8.2.0
    npm ERR! node_modules/cypress
    npm ERR!   cypress@"8.2.0" from the root project
    npm ERR!
    npm ERR! Could not resolve dependency:
    npm ERR! peer cypress@"^3 || ^4" from cypress-accessibility-checker@3.1.9
    npm ERR! node_modules/cypress-accessibility-checker
    npm ERR!   cypress-accessibility-checker@"3.1.9" from the root project
    npm ERR!
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force, or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    npm ERR!
    

Temporary Solution:

The can be fixed by running npm install --legacy-peer-deps - but this may require that other peer dependencies need to be added to your package to meet all requirements of other packages.

Solving this Bug:

This bug can be solved by ensuring that the peerDependencies object of the cypress-accessibility-checker package is either maintained with new releases of cypress or removed.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tombrunetcommented, Aug 24, 2021

Okay, pretty easy PR. We have a couple of other changes in the pipeline that should wrap up today or tomorrow. Should be out to NPM fairly soon.

0reactions
tombrunetcommented, Aug 27, 2021

@ryandudek Should be deployed as 3.1.10

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix the npm UNMET PEER DEPENDENCY warning?
UNMET PEER DEPENDENCY error is thrown when the dependencies of one or more modules specified in the package.json file is not met.
Read more >
peer dependency confilct when creating projects using vue 2 ...
receive an error says "ERESOLVE unable to resolve dependency tree". Detail: ... Could not resolve dependency: npm ERR! peer vue@"3.0.5" from ...
Read more >
Error npm UNMET PEER DEPENDENCY warning - Edureka
UNMET PEER DEPENDENCY error is thrown when the dependencies of one or more modules specified in the package.json file is not met.
Read more >
The Step-by-Step Guide to Understanding and Adopting npm 7
Here we remove the peer dependency, react , from the package.json file. Since React is part of grommet's peer dependencies, it will be...
Read more >
Unable to resolve dependency tree error in Angular while ...
To fix Unable to resolve dependency tree error in Angular while installing `npm` packages follow the below steps. 1. Run `npm install --save ......
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