2

当我运行时npm install,我收到以下错误:

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.

这是我的package.json样子:

{
  "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"
  }
}

有谁知道如何消除这个错误?

4

1 回答 1

2

这不是错误,而是警告

  1. 最简单的尝试是删除node_modules目录并重新输入以查看它是否仍然存在

    npm install
    
  2. 此外,您可以使用npm-install-peers来查找和安装所需的对等依赖项

    npm install -g npm-install-peers
    npm-install-peers
    
  3. 您还可以将日志级别更改错误,这样您就不会看到警告

于 2018-05-17T07:22:30.710 回答