Cannot install next-auth with nextjs v14
Answered
Asiatic Lion posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Asiatic LionOP
While trying to installing next-auth with latest version of nextjs I got this error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: next-auth@4.24.3
npm ERR! Found: next@14.0.0
npm ERR! node_modules/next
npm ERR! next@"^14.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^12.2.5 ^13" from next-auth@4.24.3
npm ERR! node_modules/next-auth
npm ERR! peer next-auth@"^4" from @next-auth/prisma-adapter@1.0.7
npm ERR! node_modules/@next-auth/prisma-adapter
npm ERR! @next-auth/prisma-adapter@"^1.0.7" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: next@13.5.6
npm ERR! node_modules/next
npm ERR! peer next@"^12.2.5 ^13" from next-auth@4.24.3
# npm resolution error report
While resolving: next-auth@4.24.3
Found: next@14.0.0
node_modules/next
next@"^14.0.0" from the root project
Could not resolve dependency:
peer next@"^12.2.5 ^13" from next-auth@4.24.3
node_modules/next-auth
peer next-auth@"^4" from @next-auth/prisma-adapter@1.0.7
node_modules/@next-auth/prisma-adapter
@next-auth/prisma-adapter@"^1.0.7" from the root project
Conflicting peer dependency: next@13.5.6
node_modules/next
peer next@"^12.2.5 ^13" from next-auth@4.24.3
node_modules/next-auth
peer next-auth@"^4" from @next-auth/prisma-adapter@1.0.7
node_modules/@next-auth/prisma-adapter
@next-auth/prisma-adapter@"^1.0.7" from the root project
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: next-auth@4.24.3
npm ERR! Found: next@14.0.0
npm ERR! node_modules/next
npm ERR! next@"^14.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^12.2.5 ^13" from next-auth@4.24.3
npm ERR! node_modules/next-auth
npm ERR! peer next-auth@"^4" from @next-auth/prisma-adapter@1.0.7
npm ERR! node_modules/@next-auth/prisma-adapter
npm ERR! @next-auth/prisma-adapter@"^1.0.7" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: next@13.5.6
npm ERR! node_modules/next
npm ERR! peer next@"^12.2.5 ^13" from next-auth@4.24.3
npm ERR! node_modules/next-auth
npm ERR! peer next-auth@"^4" from @next-auth/prisma-adapter@1.0.7
npm ERR! node_modules/@next-auth/prisma-adapter
npm ERR! @next-auth/prisma-adapter@"^1.0.7" 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.
# npm resolution error report
While resolving: next-auth@4.24.3
Found: next@14.0.0
node_modules/next
next@"^14.0.0" from the root project
Could not resolve dependency:
peer next@"^12.2.5 ^13" from next-auth@4.24.3
node_modules/next-auth
peer next-auth@"^4" from @next-auth/prisma-adapter@1.0.7
node_modules/@next-auth/prisma-adapter
@next-auth/prisma-adapter@"^1.0.7" from the root project
Conflicting peer dependency: next@13.5.6
node_modules/next
peer next@"^12.2.5 ^13" from next-auth@4.24.3
node_modules/next-auth
peer next-auth@"^4" from @next-auth/prisma-adapter@1.0.7
node_modules/@next-auth/prisma-adapter
@next-auth/prisma-adapter@"^1.0.7" from the root project
13 Replies
![Avatar](https://cdn.discordapp.com/avatars/657067112434499595/c78dd8e985ede1ad50c31ac682dd91a1.webp?size=256)
its not updated yet, use
npm install --force
or npm install --legacy-peer-deps
(i think this works too) as a tempory fix![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Cape horse mackerel
Or use
next-auth@beta
while waiting 🙂![Avatar](https://cdn.discordapp.com/avatars/657067112434499595/c78dd8e985ede1ad50c31ac682dd91a1.webp?size=256)
ahh they have now updated in beta, when i updated this wasn't an option (so, its nice that it has been "fixed" so fast)
wait this is an intresting idea
@/beta will give you do the new version which is a semver major and possibly breaking changes
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/1f8b69b2fc7b58b174c04d0b43498b3a.webp?size=256)
npm install next-auth@4.24.4
they have released this version with updated peerDependencies
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Cape horse mackerel
I saw on the npm v4.24.4 but couldn't find it on github, on github their latest release was v4.24.3
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/1f8b69b2fc7b58b174c04d0b43498b3a.webp?size=256)
since it's on npm it should be installable
i also only found out about it now after wandering around on npmjs.com
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Cape horse mackerel
lol 😄
![Image](https://cdn.discordapp.com/attachments/1167680558327935059/1167737540812484619/image.png?ex=654f3755&is=653cc255&hm=657c1c6206991b200c48db61cbb67559e91a0f9a8999d299c4bf9c1e812298be&)
but yeah, they've updated peers
![Image](https://cdn.discordapp.com/attachments/1167680558327935059/1167737828155863131/image.png?ex=654f3799&is=653cc299&hm=c72302564e0b447a5ef90731d343a355b5c20f6df6bc32333737c4660e0e0255&)