How to fix NPM Package Dependencies conflicts

This post is still related to my transition on using Macbook Apple Silicon, and it's about this website.

This blog is built using Gatsby.js, and the node-sass package needs to be updated and later involves other libraries with sharp dependencies to be updated and make sure that there is no mismatch with other dependencies that use it.

The fix is simple, but it could be pretty frustrating if you have never encountered this problem before.

If you must, make sure that the library is compatible with the node version you are currently running. See this post for guidance. In my case with node-sass, it needs to run on Node v15, and sharp must be upgraded to v0.28.0.

It turns out that gatsby-plugin-manifest package does not match with the sharp v0.28.0. I wonder what other packages that have sharp dependencies.

$ yarn list --pattern sharp

├─ gatsby-plugin-manifest@2.4.9
│  └─ sharp@0.25.3
├─ gatsby-plugin-sharp@2.6.9
│  └─ sharp@0.25.3
├─ gatsby-transformer-sharp@2.5.3
│  └─ sharp@0.25.3
└─ sharp@0.28.0

It will give you detailed answers, and you can decide how to adjust your dependency packages to work correctly again.

That's it!

Be the first to know when I create something new.
Join my newsletter.