这个npm真是不好用,问题一大堆

今天又碰上了,死都装不上

npm error code ERESOLVE

npm error ERESOLVE could not resolve

npm error

npm error While resolving: uni-preset-vue@0.0.0

npm error Found: @dcloudio/vite-plugin-uni@3.0.0-4000820240401001

npm error node_modules/@dcloudio/vite-plugin-uni

npm error   dev @dcloudio/vite-plugin-uni@"3.0.0-alpha-4010520240507001" from the root project

npm error

npm error Could not resolve dependency:

npm error dev @dcloudio/vite-plugin-uni@"3.0.0-alpha-4010520240507001" from the root project

npm error

npm error Conflicting peer dependency: vite@5.2.8

npm error node_modules/vite

npm error   peer vite@"^5.2.8" from @dcloudio/vite-plugin-uni@3.0.0-alpha-4010520240507001

npm error   node_modules/@dcloudio/vite-plugin-uni

npm error     dev @dcloudio/vite-plugin-uni@"3.0.0-alpha-4010520240507001" 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:UsersAdministratorAppDataLocalnpm-cache_logs2024-06-11T03_18_35_337Z-eresolve-report.txt

npm error A complete log of this run can be found in: C:UsersAdministratorAppDataLocalnpm-cache_logs2024-06-11T03_18_35_337Z-debug-0.log

度娘基本都是无用的,说是ssl证书出错,这个怎么解诀,换镜像,淘宝换到华为,全无用

最终想到可能是需要国外的资源,开hub,依然有错,再试,还错

又找原因,估计是冲突了,以前装了plus3.0,现在plus3.0alpha,不同的项目,冲突个毛线

结果问题还真是在这

找解决冲突的语句,

三种方法

一: npm i --force 无视冲突,强制获取远端npm库资源 (覆盖之前)
二: npm i --legacy-peer-deps 忽视依赖冲突,继续安装(不覆盖之前)
三: npm降级 npm @7.24.2 -g

用的第二各种,终于解决

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部
0.099449s