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

Node module dependency bug #3974

Open
Jhays10 opened this issue Jul 20, 2017 · 5 comments
Open

Node module dependency bug #3974

Jhays10 opened this issue Jul 20, 2017 · 5 comments

Comments

@Jhays10
Copy link

Jhays10 commented Jul 20, 2017

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
The requested package version is being ignored and substituted with a sub-package module in another dependency.

If the current behavior is a bug, please provide the steps to reproduce.

  • Create new project, run yarn init -y.
  • yarn add leaflet@1.0.x
  • yarn add leaflet-virtual-grid@latest
  • cd node_modules/leaflet-virtual-grid/node_modules/leaflet and vim package.json

What is the expected behavior?
When leaflet-virtual-grid is installed, its leaflet dependency shouldn't be installed, as it's already included previously. This is working correctly in NPM v5. In NPM v5, the node_modules for leaflet-virtual-grid are not installed and it will use the existing leaflet dependency.

Please mention your node.js, yarn and operating system version.

  • Node.js - v8.1.4
  • NPM - v5.0.3
  • Yarn - v0.27.5
  • MacOS - 10.12.5
@BYK
Copy link
Member

BYK commented Jul 20, 2017

This is weird. I'd expect 1.0.x to not be compatible with ^1.0.0-rc.1 which is what leaflet-virtual-grid lists but semver says otherwise:

> semver.satisfies('1.0.3', '^1.0.0-rc.1')
true

@arcanis any ideas?

@BYK
Copy link
Member

BYK commented Jul 20, 2017

@arcanis this also looks similar to #3967

@arcanis
Copy link
Member

arcanis commented Jul 20, 2017

Well it's the same issue as #3951 - leaflet-virtual-grid is using a dependencies entry instead of a peerDependencies, so they get resolved to two different versions ...

@arcanis
Copy link
Member

arcanis commented Jul 20, 2017

That being said, as @BYK noticed the hoisting should probably still have worked in this particular case since 1.0.3 is compatible with ^1.0.0-rc.1. Hm.

(I still advise you to open an issue on leaflet-virtual-grid to fix this peerDependencies thing, tho - their dependencies are currently unsafe and subject to breakages)

@Jhays10
Copy link
Author

Jhays10 commented Jul 20, 2017

Unfortunately it looks as if that project is not maintained anymore. In our project, we don't actually require leaflet-virtual-grid to be installed, it's actually a dependency through esri-leaflet which we do require. But it's certainly worth a shot of creating an issue over there as well.

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

No branches or pull requests

3 participants