vue npm install出现问题

报错如下:

js 复制代码
ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: web-ifc-viewer@1.0.218
npm ERR! Found: three@0.149.0
npm ERR! node_modules/three
npm ERR!   peer three@">=0.126.1" from camera-controls@1.38.2
npm ERR!   node_modules/camera-controls
npm ERR!     camera-controls@"^1.33.1" from web-ifc-viewer@1.0.218
npm ERR!     node_modules/web-ifc-viewer
npm ERR!       web-ifc-viewer@"^1.0.218" from the root project
npm ERR!   peer three@">= 0.123.0" from three-mesh-bvh@0.5.21
npm ERR!   node_modules/web-ifc-viewer/node_modules/three-mesh-bvh
npm ERR!     three-mesh-bvh@"^0.5.11" from web-ifc-viewer@1.0.218
npm ERR!     node_modules/web-ifc-viewer
npm ERR!       web-ifc-viewer@"^1.0.218" from the root project
npm ERR!     three-mesh-bvh@"0.5.21" from web-ifc-three@0.0.125
npm ERR!     node_modules/web-ifc-viewer/node_modules/web-ifc-three
npm ERR!       web-ifc-three@"^0.0.125" from web-ifc-viewer@1.0.218
npm ERR!       node_modules/web-ifc-viewer
npm ERR!         web-ifc-viewer@"^1.0.218" from the root project
npm ERR!   2 more (web-ifc-three, the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer three@"^0.135.0" from web-ifc-viewer@1.0.218
npm ERR! node_modules/web-ifc-viewer
npm ERR!   web-ifc-viewer@"^1.0.218" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: three@0.135.0
npm ERR! node_modules/three
npm ERR!   peer three@"^0.135.0" from web-ifc-viewer@1.0.218
npm ERR!   node_modules/web-ifc-viewer
npm ERR!     web-ifc-viewer@"^1.0.218" 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 D:\software\NVM\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:\software\NVM\nodejs\node_cache\_logs\2024-12-05T07_02_53_925Z-debug-0.log

解决方案

加入--legacy-peer-deps 如我下载npm install dat.gui 改为npm install dat.gui --legacy-peer-deps

原因

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

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

相关推荐
"追风者"1 分钟前
前端(五)css属性
前端·css
抹香鲸之海2 分钟前
快速启动Go-Admin(Gin + Vue3 + Element UI)脚手架管理系统
vue.js·golang·gin
letisgo53 分钟前
纯CSS实现文本或表格特效(连续滚动与首尾相连)
前端·css·animation
m0_7482563410 分钟前
微信小程序完整项目实战(前端+后端)
前端·微信小程序·notepad++
Li37023494021 分钟前
Vue vs. React:两大前端框架的深度对比与分析(一)
vue.js
跟着小郑学前端22 分钟前
Web前端技术宝典:期末冲刺指南
前端
鱼大大博客28 分钟前
Edge SCDN 边缘安全加速有什么用?
前端·安全·edge
m0_7482459231 分钟前
Django Web 开发基础:从入门到精通的项目实战
前端·django·sqlite
鱼大大博客32 分钟前
Edge SCDN的独特优势有哪些?
前端·edge
番茄电脑全能王34 分钟前
软件安装不成功,一直出现“chrome_elf.dll丢失”问题是什么原因?“chrome_elf.dll丢失”要怎么解决和预防?
前端·chrome·经验分享·microsoft·电脑