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 协议》,转载必须注明作者和本文链接