2

When I run npm install, I get the following error:

npm WARN [email protected] requires a peer of eslint-plugin-jsx-a11y@^5.1.1 but none is installed. You must install peer dependencies yourself.

Here is what my package.json looks like:

{
  "name": "name",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "ajv": "^6.5.0",
    "aws-amplify": "^0.4.0",
    "react": "^16.3.2",
    "react-bootstrap": "^0.32.1",
    "react-dom": "^16.3.2",
    "react-router-bootstrap": "^0.24.4",
    "react-router-dom": "^4.2.2",
    "react-scripts": "1.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "devDependencies": {
    "eslint-config-airbnb": "^16.1.0",
    "eslint-plugin-import": "^2.11.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-react": "^7.8.2"
  }
}

Does anyone know how to remove this error?

3
  • Downgrade that plugin to the 5.x its peer requires, or ignore the warning. Commented May 17, 2018 at 7:04
  • If I downgrade eslint-plugin-jsx-a11y, then I get the following error: npm WARN [email protected] requires a peer of eslint-plugin-jsx-a11y@^6.0.2 but none is installed. You must install peer dependencies yourself. Ignoring this warning is not an option. Commented May 17, 2018 at 7:19
  • Then downgrade that plugin until it's happy with the other one. Continue until no warnings, or until you get bored. Commented May 17, 2018 at 7:20

1 Answer 1

2

This is not an error, it is a WARNing

  1. The easiest trial is delete node_modules directory and retype to see if it persists

    npm install
    
  2. Moreover you can use npm-install-peers to find and install required peer dependencies

    npm install -g npm-install-peers
    npm-install-peers
    
  3. Also you can change the log level to error so that you won't see the warnings

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.