timc1 / kbar

fast, portable, and extensible cmd+k interface for your site
https://kbar.vercel.app
MIT License
4.85k stars 185 forks source link

Dependency error with `react-virtual` #330

Open HamedMP opened 1 year ago

HamedMP commented 1 year ago

I still get an error when I install packages based on react 18 even though #222. Do you have any ideas how to solve it?

npm i --force
npm WARN using --force Recommended protections disabled.
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-virtual@2.10.4
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"18.2.0" from the root project
npm WARN   29 more (@headlessui/react, @radix-ui/react-collection, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.6.3 || ^17.0.0" from react-virtual@2.10.4
npm WARN node_modules/kbar/node_modules/react-virtual
npm WARN   react-virtual@"^2.8.2" from kbar@0.1.0-beta.43
npm WARN   node_modules/kbar
npm WARN 
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^16.6.3 || ^17.0.0" from react-virtual@2.10.4
npm WARN   node_modules/kbar/node_modules/react-virtual
npm WARN     react-virtual@"^2.8.2" from kbar@0.1.0-beta.43
npm WARN     node_modules/kbar
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
thienguen commented 1 year ago
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-virtual@2.10.4
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   peer react@"^16.8 || ^17.0 || ^18.0" from @radix-ui/react-compose-refs@1.0.1
npm WARN   node_modules/@radix-ui/react-compose-refs
npm WARN     @radix-ui/react-compose-refs@"1.0.1" from @radix-ui/react-slot@1.0.2
npm WARN     node_modules/@radix-ui/react-slot
npm WARN   45 more (@radix-ui/react-context, @radix-ui/react-dialog, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.6.3 || ^17.0.0" from react-virtual@2.10.4
npm WARN node_modules/kbar/node_modules/react-virtual
npm WARN   react-virtual@"^2.8.2" from kbar@0.1.0-beta.43
npm WARN   node_modules/kbar
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^16.6.3 || ^17.0.0" from react-virtual@2.10.4
npm WARN   node_modules/kbar/node_modules/react-virtual
npm WARN     react-virtual@"^2.8.2" from kbar@0.1.0-beta.43
npm WARN     node_modules/kbar

Encountered the same error, I tried several attempts to override or npm-force-resolution but was not able to fix it.

As far as I know, there is no breaking effect towards the usage of kbar, but it would be nice to get rid of the warning messages

danmindru commented 1 year ago

with npm 9+ you can define dep overrides for a workaround:

package.json

  ...
  "overrides": {
    "react": "18.2.0"
  },

https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides

thienguen commented 1 year ago

with npm 9+ you can define dep overrides for a workaround:

package.json

  ...
  "overrides": {
    "react": "18.2.0"
  },

https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides

This works to get rid of the warning but sadly most my projects followed the LTS version of nodejs and npm. Thanks tho!

ahmadbilaldev commented 11 months ago

Facing the same warning. Is there anything we can do to help fix this?

iFreilicht commented 11 months ago

I created #348 to fix this.

@ahmadbilaldev If you want to help, test that PR in your project and see if you can find any issues.

stale[bot] commented 7 months ago

Hey! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

iFreilicht commented 7 months ago

Bad bot. Issue persists, PR to fix it was opened already.

SaadFarooq-Dev commented 7 months ago

Please if we can get this fixed. Thanks

ketangupta34 commented 6 months ago

PLease maintain this and get this fixed

ketangupta34 commented 6 months ago

need some noise here!

SaadFarooq-Dev commented 6 months ago

Bump

sohaibgv commented 3 months ago

bump

daniel-g commented 10 hours ago

please bump