npm ERR! code ERESOLVE

报错

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: laravel-mix@4.1.4
npm ERR! node_modules/laravel-mix
npm ERR!   dev laravel-mix@"^4.0.7" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer laravel-mix@"^6.0.0" from laravel-mix-versionhash@2.0.1
npm ERR! node_modules/laravel-mix-versionhash
npm ERR!   laravel-mix-versionhash@"*" 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 /root/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-07-16T10_15_43_041Z-debug-0.log
[root@larabbs larabbs57]# npm update
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.

找关键

npm ERR! Could not resolve dependency:
npm ERR! peer laravel-mix@"^6.0.0" from laravel-mix-versionhash@2.0.1

依赖冲突,前后两个依赖版本不搭配,修改 package.json 的 laravel-mix 版本为 ^6.0.0,执行 npm update 即可解决问题

本作品采用《CC 协议》,转载必须注明作者和本文链接
reading
白小二
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!