Conflicting peer dependency of [email protected] when installing [email protected] in Next.js 14.2.4
Hi
I'm install
drizzle-orm
in a Next.js project initialized with [email protected]
.
This new project has dependency to React 18.3.1.
Unfortunately, we encounter the following dependency error when install latest drizzle-orm
Do you have any idea of what could be the problem? Shall we use --force
to workaround this error?5 Replies
got the same error today @TJ Did you solved it ?
This is just a weird artifact of NPM's module resolution strategy - it tries to reconcile all dependency versions, even for optional packages which you are not using.
If you're not using React Native, forcing the installation with
--force
or --legacy-peer-deps
as mentioned in the error message should be fine. If you are using React Native, then you need to use the exact version of React which is compatible with your React Native version (here, downgrading React to 18.2.0
would mitigate the error).
Alternately, using a package manager with a more flexible resolution strategy is also an option. You shouldn't see this error when using Yarn, PNPM, or Bun, unless you are actually using React Native and the optional peer with an incompatible React version.@Flexi I installed drizzle-orm with
--force
like what @A Dapper Raccoon explained.Wow thank you so much for the explanation 🥰
🍻