NPM ERR when installing particle.js in React

4.7k views Asked by At

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.
3

There are 3 answers

0
Abdul Kader On
npm install react-particles-js --force
0
DoubleW On

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

npm install --legacy-peer-deps

fixed it for me

1
Mehmood Khan On

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