3

I am getting below error when installing particle.js in my React App:

code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project   
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0.0" from [email protected]  
npm ERR! node_modules/react-particles-js
npm ERR!   react-particles-js@"*" 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 ERR! 
npm ERR! See C:\Users\gydee\AppData\Local\npm-cache\eresolve-report.txt for a full report.
4
  • You need to downgrade your React version to version 16 because react-particle-js requires React V16 as its peer-dependency Commented Mar 1, 2021 at 10:31
  • Or you can try --legacy-peer-deps option. Commented Mar 1, 2021 at 10:37
  • Or you can use react-tsparticles package (same core library, supports React 17) Commented Mar 1, 2021 at 22:39
  • thank you I have installed react version 17 + react version 16.8.4 and it works Commented Mar 3, 2021 at 10:42

3 Answers 3

3

it is a problem coming from version 7 of npm use:

npm install --legacy-peer-deps

fixed it for me

Sign up to request clarification or add additional context in comments.

Comments

1
npm install react-particles-js --force

Comments

-1

npm install react-particles-js --force or --legacy-peer-deps

1 Comment

This is just repeating the two existing answers.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.