扬州市市政建设处网站,相册制作软件app,公司标志logo,知名商业网站有哪些文章目录 #x1f356; 前言#x1f3b6; 一、问题描述✨二、代码展示#x1f3c0;三、运行结果#x1f3c6;四、知识点提示 #x1f356; 前言
npm i --legacy-peer-deps#xff0c;解决依赖冲突问题 #x1f3b6; 一、问题描述
node执行安装指令时出现报错#xff… 文章目录 前言 一、问题描述✨二、代码展示三、运行结果四、知识点提示 前言
npm i --legacy-peer-deps解决依赖冲突问题 一、问题描述
node执行安装指令时出现报错如下
npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: mf-turbinemonitor20.0.0 npm ERR! Found: stylelint15.4.0 npm ERR! node_modules/stylelint npm ERR! dev stylelint“^15.4.0” from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer stylelint“ 11.x 15” from stylelint-config-prettier9.0.5 npm ERR! node_modules/stylelint-config-prettier npm ERR! dev stylelint-config-prettier“^9.0.5” 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! npm ERR! For a full report see: npm ERR! C:\Users\zhang\AppData\Local\npm-cache_logs\2024-04-03T09_53_27_294Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: C:\Users\zhang\AppData\Local\npm-cache_logs\2024-04-03T09_53_27_294Z-debug-0.log
✨二、代码展示
代码如下
npm i --legacy-peer-deps三、运行结果
控制台输出展示:
四、知识点提示
知识点1 –legacy-peer-deps 标志允许在 npm 7 中使用旧版的 peer dependency 解析算法这相当于回退到 npm 6 之前的解析方式在从 npm 6 迁移到 npm 7 时一些包可能还未更新以适应新的 peer dependencies 规则此时可以使用 --legacy-peer-deps 保证依赖安装顺利进行