欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

npm安裝依賴時出現(xiàn)Peer Dependencies沖突報錯解決分析

 更新時間:2023年09月11日 16:33:25   作者:luxigaola  
這篇文章主要為大家介紹了npm安裝依賴時出現(xiàn)Peer Dependencies沖突報錯解決分析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪

報錯內(nèi)容

報錯原因:由于安裝的依賴peerDependency和原先已安裝的依賴有沖突

While resolving: uni-preset-vue@0.0.0
Found: vue@3.2.47
node_modules/vue
  peer vue@"^3.2.25" from @vitejs/plugin-vue@4.3.4
  node_modules/@vitejs/plugin-vue
    ...
Conflicting peer dependency: vue@3.3.4
node_modules/vue
  peer vue@">= 2.5 < 2.7" from @vue/composition-api@1.7.2
  node_modules/@vue/composition-api
    peerOptional @vue/composition-api@"^1.4.0" from pinia@2.0.34
    node_modules/pinia
      pinia@"2.0.34" from the root project
Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

解決方案

  • 在安裝命令后面加上--force 或者--legacy-peer-deps,讓它忽略這個沖突
@REM npm 安裝
npm i pinia@2.0 --legacy-peer-deps
@REM node 安裝
yarn add pinia@2.0 --legacy-peer-deps

注意:這樣安裝并不能真正解決問題,在之后安裝其他包的時候還是需要加上這個后綴

  • 先在package.json文件中將要安裝的依賴加上,然后刪除node-modules目錄和package-lock.json文件,重新安裝依賴,讓npm install時去重新匹配依賴

以上就是npm安裝依賴時出現(xiàn)Peer Dependencies沖突報錯解決分析的詳細內(nèi)容,更多關(guān)于npm Peer Dependencies沖突解決的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評論