ejlu
ejlu

Reputation: 61

How do I read Conflicting Peer dependency? Asterisk (*) causing differences?

npm error Found: @types/[email protected]
npm error node_modules/@types/react
npm error   peerOptional @types/react@"*" from @radix-ui/[email protected]
npm error   node_modules/@radix-ui/react-arrow
npm error     @radix-ui/react-arrow@"1.1.1" from @radix-ui/[email protected]
npm error     node_modules/@radix-ui/react-popper
npm error       @radix-ui/react-popper@"1.2.1" from @radix-ui/[email protected]
npm error       node_modules/@radix-ui/react-menu
npm error         @radix-ui/react-menu@"2.1.4" from @radix-ui/[email protected]
npm error         node_modules/@radix-ui/react-dropdown-menu
npm error   peerOptional @types/react@"*" from @radix-ui/[email protected]
npm error   node_modules/@radix-ui/react-checkbox
npm error     @radix-ui/react-checkbox@"^1.1.3" from the root project
npm error   37 more (@radix-ui/react-collection, ...)
npm error
npm error Could not resolve dependency:
npm error @radix-ui/react-label@"2.0.2" from the root project
npm error
npm error Conflicting peer dependency: @types/[email protected]
npm error node_modules/@types/react
npm error   peer @types/react@"^19.0.0" from @types/[email protected]
npm error   node_modules/@types/react-dom
npm error     peerOptional @types/react-dom@"*" from @radix-ui/[email protected]
npm error     node_modules/@radix-ui/react-label
npm error       @radix-ui/react-label@"2.0.2" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error

I am trying to install @radix-ui/[email protected], but I am getting this super confusing message. When I read it I see that it is trying to install @types/react-dom@"*". Given that it's a *, why does it default to the latest types? Why doesn't it match the types that already exists on my system (i.e. 18.3.18).

Any tips on how I should read this error message?

Upvotes: 0

Views: 37

Answers (0)

Related Questions