如何解決npm i下載依賴的時候出現(xiàn)某依賴版本沖突
npm i 下載依賴的時候出現(xiàn)某依賴版本沖突
npm i 下載依賴的時候出現(xiàn)了報錯,大概就是版本的問題
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: @wangeditor/editor-for-vue@1.0.2
npm ERR! Found: @wangeditor/editor@5.0.1
npm ERR! node_modules/@wangeditor/editor
npm ERR! @wangeditor/editor@"5.0.1" from the root project
npm ERR! peer @wangeditor/editor@">=5.0.0" from @wangeditor/plugin-formula@1.0.11
npm ERR! node_modules/@wangeditor/plugin-formula
npm ERR! @wangeditor/plugin-formula@"^1.0.8" from the root project
npm ERR! 1 more (@wangeditor/plugin-mention)
npm ERR!
解決方法
在npm install 后面加 --legacy-peer-deps,就可以解決了
npm i --legacy-peer-deps
其實(shí)這個命令的本身含義就在于讓其下載依賴的時候去忽略 依賴間 帶來的沖突 (這是我個人的理解哈!)
npm下載報錯npm ERR code ERESOLVE
報錯:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vue/eslint-config-standard@6.1.0
npm ERR! Found: eslint-plugin-vue@8.7.1
npm ERR! node_modules/eslint-plugin-vue
npm ERR! peer eslint-plugin-vue@"^8.0.1" from @vue/eslint-config-typescript@9.1.0
npm ERR! node_modules/@vue/eslint-config-typescript
npm ERR! dev @vue/eslint-config-typescript@"^9.1.0" from the root project
npm ERR! dev eslint-plugin-vue@"^8.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint-plugin-vue@7.20.0
t 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 C:\Users\danxibao\AppData\Local\npm-cache\eresolve-report.txt for a full report.npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\danxibao\AppData\Local\npm-cache\_logs\2022-05-29T07_02_09_565Z-debug-0.log
解決:
- npm下載時
- --legacy-peer-deps
- 在NPM v7中,現(xiàn)在默認(rèn)安裝peerDependencies。
在很多情況下,npm版本問題會導(dǎo)致下載沖突,從而中斷安裝過程。
–legacy-peer-deps標(biāo)志是在v7中引入的,目的是繞過peerDependency自動安裝;
它告訴 NPM 忽略項目中引入的各個modules之間的相同modules但不同版本的問題并繼續(xù)安裝,保證各個引入的依賴之間對自身所使用的不同版本modules共存。
總結(jié)
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
vue2和vue3部署到服務(wù)器子目錄為空白頁問題及解決
這篇文章主要介紹了vue2和vue3部署到服務(wù)器子目錄為空白頁問題及解決,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-07-07
如何在vuejs項目中使用md5加密密碼的實(shí)現(xiàn)
本文主要介紹了如何在vuejs項目中使用md5加密密碼的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2022-08-08
Vue3組合式函數(shù)Composable實(shí)戰(zhàn)ref和unref使用
這篇文章主要為大家介紹了Vue3組合式函數(shù)Composable實(shí)戰(zhàn)ref和unref使用詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-06-06
在Nginx上部署前端Vue項目的詳細(xì)步驟(超級簡單!)
這篇文章主要介紹了在Nginx上部署前端Vue項目的詳細(xì)步驟,Nginx是一款高效的HTTP和反向代理Web服務(wù)器,作為開源軟件,Nginx以其高性能、可擴(kuò)展性和靈活性廣泛應(yīng)用于Web架構(gòu)中,文中將步驟介紹的非常詳細(xì),需要的朋友可以參考下2024-10-10

