转载至:https://www.pudn.com/news/6278d403517cd20ea4bf4a02.html
我加了自己的方式和理解
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的时候语带的eslint这些值的时候,
通常,最简单的解决方法是将 --legacy-peer-deps 标志传递给 npm,解决指令例如:

npm i vant@latest-v2 -S --legacy-peer-deps
npm install --save ant-design-vue --legacy-peer-deps

或者 -force
npm i vant@latest-v2 -S -force
npm install --save ant-design-vue -force

百度查了查

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

-f 或 --force:将强制 npm 获取远程资源,即使磁盘上存在本地副本也是如此。

–legacy-peer-deps:在安装时忽略所有 peerDependencies,采用 npm 版本 4 到版本 6 的样式。

Logo

前往低代码交流专区

更多推荐