node_modules/eslintdev eslint@”7.32.0”from the root projectpeer eslint@‘>= 4.12.1“from babel-esli

原因:npm install遇到冲突的peerDependencies时将失败。

解决--force--legacy-peer-deps选项

--force 会无视冲突,并强制获取远端npm库资源,当有资源冲突时覆盖掉原先的版本。

--legacy-peer-deps安装时忽略所有peerDependencies,忽视依赖冲突,采用npm版本4到版本6的样式去安装依赖,已有的依赖不会覆盖。

建议用 --legacy-peer-deps 选项在终端重新安装即可,该命令相对保险一点。

npm install --legacy-peer-deps

npm install postcss-pxtorem autoprefixer amfe-flexible -D npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: @vue/cli-plugin-eslint@4.5.19 npm error Found: eslint@7.32.0 npm error node_modules/eslint npm error peer eslint@">= 7.28.0" from @vue/eslint-config-prettier@7.1.0 npm error node_modules/@vue/eslint-config-prettier npm error dev @vue/eslint-config-prettier@"^7.0.0" from the root project npm error peer eslint@">= 4.12.1" from babel-eslint@10.1.0 npm error node_modules/babel-eslint npm error dev babel-eslint@"^10.1.0" from the root project npm error 6 more (eslint-config-prettier, eslint-plugin-prettier, ...) npm error npm error Could not resolve dependency: npm error peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.19 npm error node_modules/@vue/cli-plugin-eslint npm error dev @vue/cli-plugin-eslint@"^4.5.15" from the root project npm error npm error Conflicting peer dependency: eslint@6.8.0 npm error node_modules/eslint npm error peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.19 npm error node_modules/@vue/cli-plugin-eslint npm error dev @vue/cli-plugin-eslint@"^4.5.15" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error C:\Users\admin\AppData\Local\npm-cache\_logs\2025-03-05T03_23_29_961Z-eresolve-report.txt npm error A complete log of this run can be found in: C:\Users\admin\AppData\Local\npm-cache\_logs\2025-03-05T03_23_29_961Z-debug-0.log
03-08
npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: eslint-loader@2.2.1 npm WARN Found: eslint@7.15.0 npm WARN node_modules/eslint npm WARN dev eslint@"7.15.0" from the root project npm WARN 4 more (@vue/cli-plugin-eslint, babel-eslint, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer eslint@">= 1.6.0" from @vue/cli-plugin-eslint@4.4.6 npm WARN node_modules/@vue/cli-plugin-eslint npm WARN dev @vue/cli-plugin-eslint@"4.4.6" from the root project npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: eslint-loader@2.2.1 npm WARN Found: eslint@7.15.0 npm WARN node_modules/eslint npm WARN dev eslint@"7.15.0" from the root project npm WARN 4 more (@vue/cli-plugin-eslint, babel-eslint, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer eslint@">= 4.12.1" from babel-eslint@10.1.0 npm WARN node_modules/babel-eslint npm WARN dev babel-eslint@"10.1.0" from the root project npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: eslint-loader@2.2.1 npm WARN Found: eslint@7.15.0 npm WARN node_modules/eslint npm WARN dev eslint@"7.15.0" from the root project npm WARN 4 more (@vue/cli-plugin-eslint, babel-eslint, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer eslint@"^6.2.0 || ^7.0.0" from eslint-plugin-vue@7.2.0 npm WARN node_modules/eslint-plugin-vue npm WARN dev eslint-plugin-vue@"7.2.0" from the root project npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: eslint-loader@2.2.1 npm WARN Found: eslint@undefined npm WARN node_modules/eslint npm WARN dev eslint@"7.15.0" from the root project npm WARN npm WARN Could not resolve dependency: npm WARN peer eslint@">=1.6.0 <7.0.0" from eslint-loader@2.2.1 npm WARN node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader npm WARN eslint-loader@"^2.2.1" from @vue/cli-plugin-eslint@4.4.6 npm WARN node_modules/@vue/cli-plugin-eslint npm ERR! code ENOTFOUND npm ERR! syscall getaddrinfo npm ERR! errno ENOTFOUND npm ERR! network request to http://registry.cnpmjs.org/eslint failed, reason: getaddrinfo ENOTFOUND registry.cnpmjs.org npm ERR! network This is a problem related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. See: 'npm help config' npm ERR! A complete log of this run can be found in: npm ERR! D:\Nodejs\node_cache\_logs\2023-06-05T01_57_35_554Z-debug-0.log
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值