How do I read npm “conflicting peer dependency” error messages?

Recommendation:

Check out Yarn.

I was able to circumvent the issue in NPM by using Yarn instead of NPM. Yarn is basically a wrapper utility around NPM that adds extra features, which are super useful. It’s especially helpful for managing NPM dependencies better.

For instance, it can check if a package is already installed on your machine for another project, directly or as a sub dependency, and can reuse that installed version rather than re-installing a copy of the same package; saves space and makes for faster installations, especially with some of the most common dependencies.

So, due to the optimized way Yarn handles dependencies, I think it helps avoid this issue faced by the OP.

Resolution:

  1. First, delete the node_modules folder in your project.
  2. Yarn will complain about any package-lock.json files, so delete that too (or back it up, then delete it). Do not delete package.json, yarn will need that.
  3. Simply install yarn: npm i yarn (you could do this globally, too).
  4. Then run yarn install in your project directory.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)