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

eleventy 0.11.0 dependency error #17

Closed
GrantSmithDoddle opened this issue Mar 23, 2021 · 8 comments · Fixed by #18
Closed

eleventy 0.11.0 dependency error #17

GrantSmithDoddle opened this issue Mar 23, 2021 · 8 comments · Fixed by #18
Labels
bug Something isn't working released

Comments

@GrantSmithDoddle
Copy link

This is most likely user error, but I am receiving a dependency error whilst trying to install eleventy-plugin-sitemap.

npm ERR! Found: @11ty/[email protected]
npm ERR! node_modules/@11ty/eleventy
npm ERR!   dev @11ty/eleventy@"^0.12.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @11ty/eleventy@"^0.11.0" from @quasibit/[email protected]
npm ERR! node_modules/@quasibit/eleventy-plugin-sitemap
npm ERR!   dev @quasibit/eleventy-plugin-sitemap@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
@nunof07
Copy link
Member

nunof07 commented Mar 23, 2021

Seems like it's due to the eleventy version difference.

I will try to setup a reproduction later this week.

@wilpar
Copy link

wilpar commented Mar 25, 2021

same.


node_modules/pug
  @11ty/eleventy  <=0.11.1
  Depends on vulnerable versions of pug
  node_modules/@11ty/eleventy
    @quasibit/eleventy-plugin-sitemap  *
    Depends on vulnerable versions of @11ty/eleventy
    node_modules/@quasibit/eleventy-plugin-sitemap

@nunof07 nunof07 added bug Something isn't working and removed bug Something isn't working labels Mar 26, 2021
@nunof07
Copy link
Member

nunof07 commented Mar 26, 2021

I had no problem running this plugin in a project running eleventy at ^0.12.1.

Please setup a reproduction or show me your package.json.

@nunof07 nunof07 added the question Further information is requested label Mar 26, 2021
@jarrodconnolly
Copy link

I am also seeing this issue.
npm install on my project works using npm v6.14.12 and fails using v7.7.5

The following steps can reproduce this using npm v7.7.5

mkdir npm-test-11ty-sitemap
cd npm-test-11ty-sitemap
npm init -y
npm install @11ty/eleventy
npm install @quasibit/eleventy-plugin-sitemap
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @11ty/[email protected]
npm ERR! node_modules/@11ty/eleventy
npm ERR!   @11ty/eleventy@"0.12.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @11ty/eleventy@"^0.11.0" from @quasibit/[email protected]
npm ERR! node_modules/@quasibit/eleventy-plugin-sitemap
npm ERR!   @quasibit/eleventy-plugin-sitemap@"*" 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.

I believe this is due to the change in NPM v7 to automatically install peerDependencies.
https://github.com/npm/rfcs/blob/latest/implemented/0025-install-peer-deps.md

Presently @quasibit/eleventy-plugin-sitemap has this set to:

  "peerDependencies": {
    "@11ty/eleventy": "^0.11.0"
  },

This falls into the special caret handling because 11ty is pre 1.0.0 as discussed here:
https://docs.npmjs.com/cli/v6/using-npm/semver#caret-ranges-123-025-004

This causes the current 0.12.1 version of 11ty not to match the ^0.11.0 causing a dependency conflict.

@nunof07
Copy link
Member

nunof07 commented Mar 28, 2021

Thanks for the detailed explanation @jarrodconnolly . I was using npm v6 so didn't notice this.

Not sure what's the best solution here, updating the peer dependency to the latest version?

I'll check this, this week.

@jarrodconnolly
Copy link

I believe if you update your peerDependencies to the latest 0.12 it would also force people to upgrade who are still using 11ty 0.11 which you are still compatible with afaik.

A good solution might be to be explicit and say:

"peerDependencies": {
    "@11ty/eleventy": ">=0.11.0 <0.13.0"
  },

Then you can reassess when 0.13.0 comes out and change if everything appears to be working.

You can play with this option and others here to get an idea what they will do:
https://jubianchi.github.io/semver-check/#/%3E%3D0.11.0%20%3C0.13.0/0.11.0

@nunof07 nunof07 added the bug Something isn't working label Mar 30, 2021
@nunof07 nunof07 removed the question Further information is requested label Mar 30, 2021
github-actions bot pushed a commit that referenced this issue Mar 30, 2021
## [2.0.5](v2.0.4...v2.0.5) (2021-03-30)

### Bug Fixes

* update eleventy peer dependency to support v12 ([9eeac05](9eeac05)), closes [#17](#17)
@github-actions
Copy link

🎉 This issue has been resolved in version 2.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nunof07
Copy link
Member

nunof07 commented Mar 30, 2021

@jarrodconnolly thank you again, that was very useful.

I pushed a fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants