Beheben Sie den Upstream-Abhängigkeitskonflikt beim Installieren von NPM-Paketen
Lesezeit: 2 Minuten
Beim Versuch, vue-mapbox mapbox-gl mit npm zu installieren, erhalte ich einen Abhängigkeitsbaumfehler.
Ich verwende Nuxt SSR mit Vuetify und habe nichts installiert, was mit Mapbox zu tun hat, bevor ich diese Installation ausgeführt und diesen Fehler erhalten habe.
38 Fehlercode ERESOLVE 39 Fehler ERESOLVE kann den Abhängigkeitsbaum nicht auflösen 40 Fehler 41 Fehler Beim Auflösen: [1mexample[22m@[1m1.0.0[22m
41 error Found: [1mmapbox-gl[22m@[1m1.13.0[22m[2m[22m
41 error [2mnode_modules/mapbox-gl[22m
41 error [1mmapbox-gl[22m@"[1m^1.13.0[22m" from the root project
41 error
41 error Could not resolve dependency:
41 error [35mpeer[39m [1mmapbox-gl[22m@"[1m^0.53.0[22m" from [1mvue-mapbox[22m@[1m0.4.1[22m[2m[22m
41 error [2mnode_modules/vue-mapbox[22m
41 error [1mvue-mapbox[22m@"[1m*[22m" from the root project
41 error
41 error Fix the upstream dependency conflict, or retry
41 error this command with --force, or --legacy-peer-deps
41 error to accept an incorrect (and potentially broken) dependency resolution.
41 error
41 error See /Users/user/.npm/eresolve-report.txt for a full report.
42 verbose exit 1
What’s the right way to go about fixing this upstream dependency conflict?
npm: When to use --force and --legacy-peer-deps might be helpful
– ggorlen
Apr 28, 2021 at 1:36
Shivam Yadav
Use --legacy-peer-deps after npm install. For example, if you want to install radium, use:
npm install --legacy-peer-deps --save radium
hatake kakashi
There are TWO ways:
use npm install --legacy-peer-deps to install, and if this doesn’t work use
force method. add –force next to npm install: npm install --force
until npm version 7.19.1 still have same issue, after upgraded to version 7.20.3 use command npm install -g npm@latest and npm audit fix all pkgs fixed without error.
delete the package-lock.json file
modify the package.json , updating the version as indicated by the peer dependancy
run npm install or npm udpate
DharmanBot
To Solve Fix the upstream dependency conflict installing NPM packages Error
Method 1.Just Use –legacy-peer-deps after npm install.
For example, if you want to install axios, use
npm install --legacy-peer-deps --save axios.
Method 2.Updating npm and audit fix
npm I -g npm@latest
npm audit fix --force
Method 3.using –force to install packages
npm install axios --force
Jakub Kurdziel
You can follow this command
first type:
npm config set legacy-peer-deps true
then type:
npx create-react-app my-app
10101600cookie-checkBeheben Sie den Upstream-Abhängigkeitskonflikt beim Installieren von NPM-Paketenyes