当前位置: 首页 > 工具软件 > Normalize.css > 使用案例 >

npm install错误,安装normalize.css--save报错

通令
2023-12-01

简单记录一下,侵删

PS D:\CHERYL___Code_\系统学习代码\20vue\jingdongdong> npm install normalize.css --save
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! 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\阿思的烤饼\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\阿思的烤饼\AppData\Local\npm-cache\_logs\2022-10-19T07_31_43_088Z-debug-0.log

原因:

在NPM v7中,现在默认安装peerDependencies

在很多情况下,这会导致版本冲突,从而中断安装过程。

--legacy-peer-deps标志是在v7中引入的,目的是绕过peerDependency自动安装;它告诉 NPM 忽略项目中引入的各个modules之间的相同modules但不同版本的问题并继续安装,保证各个引入的依赖之间对自身所使用的不同版本modules共存。

参考:npm下载报错npm ERR code ERESOLVE_Aaron Con的博客-CSDN博客_npm 下载报错

--legacy-peer-deps 作用_longfei815的博客-CSDN博客_legacy-peer-deps

 类似资料: