意见反馈
帮助中心
官方微信

Bug记录——在使用npm install时遇到的问题 npm ERR! code ERESOLVE

发布者:Carl
发布时间:2023年05月29日
阅读量:481

在使用npm install时遇到的问题

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: react_staging@0.1.0      
npm ERR! Found: react-scripts@1.1.5
roject
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.

找了好久才解决,原来因为npm7.x对某些事情比npm6.x更严格。
通常,最简单的解决方法是将--legacy-peer-deps标志传递给npm(e.g.,npm i --legacy-peer-deps),或者使用npm@6。

提示:使用npm@6不需要卸载npm@7。使用npx指定npm的版本。例如:npx -p npm@6 npm i --legacy-peer-deps

如果这不能立即起作用,也许可以先删除node_modulespackage-lock.json。它们将被重新创建。


转载自:(51条消息) 在使用npm install时遇到的问题 npm ERR! code ERESOLVE_程序燕的博客-CSDN博客



全部评论

没有评论