npm install bootstrap@5.1.3 --save 提示如下错误,请问是npm版本问题吗? 您使用的是什么版本?
来源:4-3 样式解决方案简介和分析
慕少1345634
2022-06-02
pm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vue/eslint-config-standard@6.1.0
npm ERR! Found: eslint-plugin-vue@8.7.1
npm ERR! node_modules/eslint-plugin-vue
npm ERR! dev eslint-plugin-vue@"^8.0.3" from the root project
npm ERR! peer eslint-plugin-vue@"^8.0.1" from @vue/eslint-config-typescript@9.1.0
npm ERR! node_modules/@vue/eslint-config-typescript
npm ERR! dev @vue/eslint-config-typescript@"^9.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint-plugin-vue@7.20.0
npm ERR! node_modules/eslint-plugin-vue
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^6.1.0" 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!
npm ERR! See /Users/kangliangliang/.npm/eresolve-report.txt for a full report.
版本
npm -v
8.6.0
package.json
"devDependencies": {
"@typescript-eslint/eslint-plugin": “^5.4.0”,
"@typescript-eslint/parser": “^5.4.0”,
"@vue/cli-plugin-eslint": “~5.0.0”,
"@vue/cli-plugin-typescript": “~5.0.0”,
"@vue/cli-service": “~5.0.0”,
"@vue/eslint-config-standard": “^6.1.0”,
"@vue/eslint-config-typescript": “^9.1.0”,
“eslint”: “^7.32.0”,
“eslint-plugin-import”: “^2.25.3”,
“eslint-plugin-node”: “^11.1.0”,
“eslint-plugin-promise”: “^5.1.0”,
“eslint-plugin-vue”: “^8.0.3”,
“typescript”: “~4.5.5”
}
1回答
-
张轩
2022-06-02
同学你好
遇到这种情况,建议重装就好,npm 8 以上会检查一些包的对应关系,之前有可能没有安装好,有的依赖互相有问题,就会出现这样的错误。
1 删除 node_modules 以及 package-lock.json
然后重新 npm install 试一下
2 可以降级 npm 的版本,node 降到 14 就可以(当然也需要重新安装依赖)
00
相似问题
回答 2
回答 1