我正在尝试安装Strapi项目。运行npm install之后,我得到以下对等依赖性警告:
npm WARN eslint-config-airbnb@13.0.0 requires a peer of eslint@^3.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@13.0.0 requires a peer of eslint-plugin-jsx-a11y@^2.2.3 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@13.0.0 requires a peer of eslint-plugin-react@^6.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb-base@10.0.1 requires a peer of eslint@^3.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN react-ga@2.5.6 requires a peer of prop-types@^15.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-ga@2.5.6 requires a peer of react@^15.6.2 || ^16.0 but none is installed. You must install peer dependencies yourself.
但是,当我检查这些软件包的安装版本时,一切似乎都很好。例如:
$ npm view eslint version
5.9.0
$ npm view prop-types version
15.6.2
这是由Strapi生成的package.json(我添加的prop-type和react的依赖项)
"devDependencies": {
"babel-eslint": "^7.1.1",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^13.0.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-react": "^7.7.0"
},
"dependencies": {
"lodash": "^4.17.5",
"strapi": "3.0.0-alpha.15",
"strapi-utils": "3.0.0-alpha.15",
"strapi-hook-mongoose": "3.0.0-alpha.15",
"prop-types": "^15.6.0",
"react": "^15.6.2"
},
这与本地安装的软件包还是全局安装的软件包有关?任何帮助都非常感谢!
答案 0 :(得分:0)
npm WARN eslint-config-airbnb@13.0.0 requires a peer of eslint@^3.9.1
表示它需要 eslint 的 3.9.x 版本,因此您安装的 5.9.0 版本太高。我建议您更新到 eslint-config-airbnb 的版本 17.1.0 ,然后使用 eslint 5.3.0 。