skip to Main Content

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’

enter image description here

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


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

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.

  3. Steps to fix this error


    1. Figure out and resolve the conflicting dependency
    2. Clear cache, remove node_modules, package-lock.json and reinstall everything
    3. Upgrade to the latest NPM version or use a specific version
    4. Use the –legacy-peer-deps flag
    5. Use yarn instead of NPM as your package manager
    6. Downgrade your version of NPM
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search