nanostores / query

⚡️ Powerful data fetching library for Nano Stores. TS/JS. Framework agnostic.
MIT License
229 stars 10 forks source link

Can't install @nanostores/query (npm ERR! code ERESOLVE) #44

Closed overtune closed 5 months ago

overtune commented 5 months ago

Hi!

I just updated nanostores and @nanostores/query in a project, but got npm errors. So I tested to install these two packages in a new and empty project and got the same errors...

First I installed nanostores:

➜  npm i nanostores

added 1 package, and audited 2 packages in 2s

That works, but when I install @nanostores/query I get an ERESOLVE error:

➜  npm i @nanostores/query
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: nanostores@0.10.3
npm ERR! node_modules/nanostores
npm ERR!   nanostores@"^0.10.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer nanostores@">0.10" from @nanostores/query@0.3.0
npm ERR! node_modules/@nanostores/query
npm ERR!   @nanostores/query@"*" 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 use node v20.11.1 (npm v10.2.4). If I try installing an older version of @nanostores/query (npm i @nanostores/query@0.2.10) everything works fine.

Is this some problem with @nanostores/query or is it my machine?

dkzlv commented 5 months ago

@overtune Hey!

All's good, don't worry. I made a mistake when set the lower requirement for nanostores as peer dedendency. It's gonna be fixed shortly in #43.

TIL npm doesn't allow installing a dep at all in this case. That's crazy, yarn and pnpm show an error but proceed with the install.

mrfratello commented 5 months ago

as a workaround, you can write in the package.json of project:

  "overrides": {
    "nanostores": "$nanostores"
  }

and then install @nanostores/query