Next.js Discord

Discord Forum

Error installing react-three/fiber

Answered
Tibbs posted this in #help-forum
Open in Discord
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: nextjs-portfolio@0.1.0
npm error Found: react@19.0.0
npm error node_modules/react
npm error   react@"^19.0.0" from the root project
npm error   peer react@"*" from expo@52.0.27
npm error   node_modules/expo
npm error     peerOptional expo@">=43.0" from @react-three/fiber@8.17.12
npm error     node_modules/@react-three/fiber
npm error       @react-three/fiber@"*" from the root project
npm error     peer expo@"*" from @expo/dom-webview@0.0.2
npm error     node_modules/@expo/dom-webview
npm error       peerOptional @expo/dom-webview@"*" from expo@52.0.27
npm error     3 more (expo-asset, expo-file-system, expo-gl)
npm error   5 more (@expo/dom-webview, react-native-webview, expo-asset, ...)
npm error
npm error Could not resolve dependency:
npm error peer react@">=18 <19" from @react-three/fiber@8.17.12
npm error node_modules/@react-three/fiber
npm error   @react-three/fiber@"*" 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.
Answered by Jboncz
well I think its @react-three/fiber lol
View full answer

18 Replies

Ahhh just do npm i with --legacy-peer-deps
Weird why expo is mentioned too
You might have to do that a bit, its because nextjs is using react 19
so npm i react-three/fiber --legacy-peer-dep
npm error code 128
npm error An unknown git error occurred
npm error command git --no-replace-objects ls-remote ssh://git@github.com/react-three/fiber.git
npm error ERROR: Repository not found.
npm error fatal: Could not read from remote repository.
npm error
npm error Please make sure you have the correct access rights
npm error and the repository exists.
well I think its @react-three/fiber lol
Answer
whatever you used before to install it, just add --legacy-peer-dep
Didn't even spot that.. thanks lol
my bad, like I said never sued it
used*
No worries, appreciate the help, never used that flag before for installing a package either
Its just because we are in a weird state with react 19
since its new
Original message was deleted
Mark an answer with this.
Makes sense, I'm too used to vite
app has to state its compatible with react 19, technically there could be issues, they havent validated its ready for r19, but mostly there arent breaking changes.
Ty again
np np