In the interim while I was getting to the next stage of this app, I ran into (what was I doing? 🤷🏼♂️) this error.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: next-auth@4.24.10
npm ERR! Found: react@19.0.0-rc-66855b96-20241106
npm ERR! node_modules/react
npm ERR! react@"19.0.0-rc-66855b96-20241106" from the root project
npm ERR! peer react@"^18.2.0 || 19.0.0-rc-66855b96-20241106" from next@15.0.3
npm ERR! node_modules/next
npm ERR! next@"15.0.3" from the root project
npm ERR! peer next@"^12.2.5 || ^13 || ^14 || ^15" from next-auth@4.24.10
npm ERR! node_modules/next-auth
npm ERR! next-auth@"^4.24.10" from the root project
npm ERR! 2 more (react-dom, styled-jsx)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.2 || ^18" from next-auth@4.24.10
npm ERR! node_modules/next-auth
npm ERR! next-auth@"^4.24.10" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react@18.3.1
npm ERR! node_modules/react
npm ERR! peer react@"^17.0.2 || ^18" from next-auth@4.24.10
npm ERR! node_modules/next-auth
npm ERR! next-auth@"^4.24.10" 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.
As with these dependency issue errors I was getting, which seems to be somewhat common with React these days (or maybe just most of web development!), I went about fixing it with the following steps.
First I removed the existing next-auth installation.
npm uninstall next-auth
Next I installed the beta version of next auth that supports Next.js 15 and React 19 (yes, I RTFMed (i.e. Read The Fucking Manual) a bit and read some other things to finally get to that conclusion).
Continue reading “The Confederacy of Errors Starting With Next Auth; Error, Error, npm ERR!” →Like this:
Like Loading...
You must be logged in to post a comment.