安装eslint后可能因为eslint版本过高导致axios安装失败,也就是包冲突
有两个命令可以解决此问题
- 一是 --force 无视冲突,强制获取远端npm库资源 (覆盖之前)
- 二是 --legacy-peer-deps 忽视依赖冲突,继续安装(不覆盖之前)
可以采用的的语句:
npm install axios --force 或者 npm install axios --legacy-peer-dep
-f 或 --force:将强制 npm 获取远程资源,即使磁盘上存在本地副本也是如此。
--legacy-peer-deps:在安装时忽略所有 peerDependencies,采用 npm 版本 4 到版本 6 的样式。
记录报错信息:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vue/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint-plugin-vue
npm ERR! dev eslint-plugin-vue@"^8.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/[email protected]
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: [email protected]
npm ERR! node_modules/eslint-plugin-vue
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/[email protected]
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 C:\Users\29756\AppData\Local\npm-cache\eresolve-report.txt for a full report.
标签:npm,axios,ERR,--,standard,vue,eslint,安装
From: https://www.cnblogs.com/fwdba/p/16714189.html