-1

I'm trying to install @react-three/drei and react-three/fiber@alpha for a 3d globe componenet in nextjs. but i get the below error when i try to install them.

npm error node_modules/@react-three/fiber
npm error   @react-three/fiber@"9.0.0-alpha.8" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @react-three/fiber@"^8" from @react-three/[email protected]
npm error node_modules/@react-three/drei
npm error   @react-three/drei@"*" 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

I get that this is some kind of dependency conflict cause by react-three/drei not accepting a version of @react-three/fiber a try to install the specific version of reat-three/fiber so that it can work.
But i get another error of downgrade my react19 to react18 and even if i downgrade it doesnt resolve .

I tried legacy command also but that also did not work.

1
  • i had the same issue, im using nextjs14.2.25, so what i did is: npm i @react-three/[email protected] followed by npm i @react-three/[email protected]. How i arrived at this, i went to the npm website searched for the related modules, and looked at previous version which had more downloads and some few months. Commented Mar 23 at 22:11

2 Answers 2

1

The issue occurring due to new React 19 version, because React 19 is not officially supporting @react-three/fiber yet.

To Resolve this

  1. Downgrade to React 18
  • npm uninstall react react-dom
  • npm install react@18 react-dom@18

Then install @react-three/fiber

  1. For @react-three/drei after installing it you might get an error saying [email protected] is deprecated, just simply use v0.8.0 version
Sign up to request clarification or add additional context in comments.

Comments

0

React 19 currently does not support the latest version 8.17 of react three fiber. You might wanna install the Release Candidate version 9 by running:

npm i @react-three/[email protected]

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.