日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

npm install報錯 Fix the upstream dependency conflict, or retrynpm ERR! this command with --forc

作者:Bunny0212 更新時間: 2024-03-15 編程語言

npm install報錯 Fix the upstream dependency conflict, or retrynpm ERR! this command with --force or --legacy-peer-depsnpm ERR! to accept an incorrect (and potentially broken) dependency resolution.

npm ERR! Could not resolve dependency:
npm ERR! peer react-scripts@"^2.1.3" from craco-sass-resources-loader@1.1.0
npm ERR! node_modules/craco-sass-resources-loader
npm ERR!   dev craco-sass-resources-loader@"^1.1.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react-scripts@2.1.8
npm ERR! node_modules/react-scripts
npm ERR!   peer react-scripts@"^2.1.3" from craco-sass-resources-loader@1.1.0
npm ERR!   node_modules/craco-sass-resources-loader
npm ERR!     dev craco-sass-resources-loader@"^1.1.0" 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 install 后面加上--force 或者 --legacy-peer-deps其實說的也對,但是如果每次元件這個問題都這么做的話難免很麻煩,而且不太像真正的解決問題。
使用這個命令,每次安裝時自動執行,也就是默認選項為npm install legacy-peer-deps這樣就好多了

npm set legacy-peer-deps=true

原文鏈接:https://blog.csdn.net/weixin_46533577/article/details/135598476

  • 上一篇:沒有了
  • 下一篇:沒有了
欄目分類
最近更新