如何解決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
其實這個命令的本身含義就在于讓其下載依賴的時候去忽略 依賴間 帶來的沖突 (這是我個人的理解哈!)
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)文章
詳解vue-flickity的fullScreen功能實現(xiàn)
這篇文章主要介紹了詳解vue-flickity的fullScreen功能實現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-04-04Vue3中的極致防抖/節(jié)流詳解(附常見方式防抖/節(jié)流)
在JavaScript中函數(shù)的防抖和節(jié)流不是什么新鮮話題,這篇文章主要給大家介紹了關(guān)于Vue3中極致防抖/節(jié)流的相關(guān)資料,文中通過實例代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-02-02