I wanted to simply update the project’s packages and run the base commands, but I keep getting these errors that I hadn’t encountered before. I’m not sure if its something I did, since I hadn’t touched this particular project for a month.
I’ve attached an image of the error I receive when I run ‘npm update’
I tried all the various default commands and ensured nothing was missing in terms of installers, but it keeps resulting in the same error
3
Answers
You’ve got this error due to "react-reveal" library. It has not been updated for 5 years. Its dependencies are looking for react 15 or 16. You use react v18 so its throwing an error that it might not work with that version. It may still works fine with react v18, but you need to install "react-revial" with the command "npm install react-reveal –legacy-peer-deps".
As an alternative option you can use "react-awesome-reveal" instead of "react-revial" or some other library.
you can install this by
npm install --legacy-peer-deps
You can also use –force as
–legacy-peer-deps ignores peer dependencies entirely, which can screw up your dependency resolution.
–force on the other hand simply sets a different peer dependency version for conflicting dependencies
To set legacy-peer-deps by default
npm config set legacy-peer-deps true
Steps to fix this error