F:\study\heima\vueCode\demo3>npm i axios -S
npm 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! 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! to
accept an incorrect (and potentially broken) dependency resolution.
npm ERR! npm ERR! See
D:\sInstallation\nodejs\node_cache\eresolve-report.txt for a full
report.

npm ERR! A complete log of this run can be found in: npm ERR!
D:\sInstallation\nodejs\node_cache_logs\2022-10-21T01_53_58_059Z-debug-0.log

在这里插入图片描述

这里我在 npm i axios -S 或者其他依赖包的时候出现以上错误

可能是npm版本问题报错

解决方法:在命令后面加上

--legacy-peer-deps**

即以下这种

npm i axios -S --legacy-peer-deps

安装一些依赖时报错如上的代码图片所示

解决方案:在完整的指令后面添加–legacy-peer-deps

这样写之后就可以安装成功了
在这里插入图片描述

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐