Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm: Could not resolve dependency: peer leaflet@"^1.9.3" #304

Open
velle opened this issue Nov 20, 2024 · 2 comments
Open

npm: Could not resolve dependency: peer leaflet@"^1.9.3" #304

velle opened this issue Nov 20, 2024 · 2 comments
Assignees
Labels

Comments

@velle
Copy link

velle commented Nov 20, 2024

The commands below are run in a clean Ubuntu 22.04 container with npm 9.2.0.

root@79f1aecaf65b:/# git clone https://github.com/mapcentia/vidi.git
root@79f1aecaf65b:/# cd vidi
root@79f1aecaf65b:/vidi# npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @maplibre/maplibre-gl-leaflet@0.0.22
npm ERR! Found: leaflet@1.7.1
npm ERR! node_modules/leaflet
npm ERR!   peer leaflet@"1.7.1" from leaflet.glify@3.2.0
npm ERR!   node_modules/leaflet.glify
npm ERR!     leaflet.glify@"^3.2.0" from the root project
npm ERR!   peer leaflet@"^1.3.1" from leaflet.markercluster@1.5.3
npm ERR!   node_modules/leaflet.markercluster
npm ERR!     leaflet.markercluster@"^1.4.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer leaflet@"^1.9.3" from @maplibre/maplibre-gl-leaflet@0.0.22
npm ERR! node_modules/@maplibre/maplibre-gl-leaflet
npm ERR!   @maplibre/maplibre-gl-leaflet@"^0.0.22" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: leaflet@1.9.4
npm ERR! node_modules/leaflet
npm ERR!   peer leaflet@"^1.9.3" from @maplibre/maplibre-gl-leaflet@0.0.22
npm ERR!   node_modules/@maplibre/maplibre-gl-leaflet
npm ERR!     @maplibre/maplibre-gl-leaflet@"^0.0.22" 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 ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /root/.npm/_logs/2024-11-20T18_55_30_252Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-11-20T18_55_30_252Z-debug-0.log
@velle
Copy link
Author

velle commented Nov 20, 2024

I don't quite understand what the actual problem is, if there is one. But this workaround worked for me (with npm 9.2.0):

npm install --legacy-peer-deps

And I think npm versions 4-6 don't raise these problems (source).

@mapcentia mapcentia added the bug label Nov 21, 2024
@mapcentia mapcentia self-assigned this Nov 21, 2024
@mapcentia
Copy link
Owner

It's leaflet.glify which has a specific version of leaflet as dependency. Luckily the latest glify has leaflet@1.9.4 as dependency, which satisfies other dependent modules. This will be fixed is next release. Just use --legacy-peer-deps or update leaflet.glify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants