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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deps issues due to major bump of ajv #23

Closed
majapw opened this issue Feb 13, 2018 · 4 comments
Closed

Deps issues due to major bump of ajv #23

majapw opened this issue Feb 13, 2018 · 4 comments

Comments

@majapw
Copy link

majapw commented Feb 13, 2018

Hello!

Recently #22 was released as part of a patch update. Unfortunately, bumping a peer dep a major version causes all sorts of deps 馃敟s up the tree and my tests are now all failing on npm ls.

Can we undo this change and republish as a major?

@ljharb @gabergg @airbnb/webinfra

@backwardok
Copy link

as one example, eslint is pegged to version 5: https://github.com/eslint/eslint/blob/master/package.json#L37

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Feb 13, 2018

While ajv released a major, for schema-utils it's still a patch (no breaking changes). What exactly is breaking setups atm ? Normally node_modules should simply contain two versions of ajv if other dependencies require different major versions of the package

@majapw
Copy link
Author

majapw commented Feb 13, 2018

Ahh, you're totally right. I thought that ajv was a peer dep of this package but it is a direct dep. I'm super sorry! This is a problem elsewhere in my tree. :|

Sorry for the red flag!

@filipesilva
Copy link

Heya, I'm also looking into this as part of angular/angular-cli#9691 and I'm not too sure what to make of it.

At the moment I think this is a npm bug.

I added a reproduction in https://github.com/filipesilva/ajv-peerdep-issue and reported it in npm/npm#19877.


ajv-peerdep-issue

This repo shows a problem with how npm@5.6.0 hoists dependencies that have peer dependencies.

Running npm install will show the following warning:

npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.

The following dependencies are relevant:

  • this repro itself depends on two packages: ajv@5.5.2 and webpack@3.11.0.
  • webpack@3.11.0 depends on ajv@^6.1.0 and ajv-keywords@^3.1.0.
  • ajv-keywords@3.1.0 has a peer dependency on ajv@^6.0.0

When npm resolves these dependencies they end up looking like this:

ajv-peerdep-issue@1.0.0 D:\sandbox\ajv-peerdep-issue
`-- ajv@5.5.2
`-- ajv-keywords@3.1.0
`-- webpack@3.11.0
  `-- ajv@6.1.0

This is a problem because the hoisted ajv-keywords@3.1.0 will not have its peer dependency on ajv@^6.0.0 met.

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

No branches or pull requests

4 participants