2

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

npm WARN eslint-config-react-app@2.1.0 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?

Ralph David Abernathy
  • 5,230
  • 11
  • 51
  • 78
  • Downgrade that plugin to the 5.x its peer requires, or ignore the warning. – jonrsharpe May 17 '18 at 07:04
  • If I downgrade `eslint-plugin-jsx-a11y`, then I get the following error: `npm WARN eslint-config-airbnb@16.1.0 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. – Ralph David Abernathy May 17 '18 at 07:19
  • Then downgrade *that* plugin until it's happy with the other one. Continue until no warnings, or until you get bored. – jonrsharpe May 17 '18 at 07:20

1 Answers1

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

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Josem
  • 378
  • 7
  • 15