Technical

How to solve – “Node Sass version 8.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0”

How to solve – “Node Sass version 8.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0”

So after cloning some NodeJS repo, or even your own repo, and when trying to build you get the error:

“Node Sass version 8.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0”

This is annoying I know, I spent a few hours yesterday trying to fix that even with my own repo. There were some suggestion to just find a compatible version of Node and NVM but sometimes we cannot use the latest version of NodeJS. So here is your simplest solution:

If you are using yarn

1. Remove “node-sass”

yarn remove node-sass

2. Instead “sass” instead of “node-sass”

yarn add -D sass

For those who you are using npm

1. Remove “node-sass”

npm uninstall node-sass

2. Instead “sass” instead of “node-sass”

npm i -D sass


Try to run “yarn” again, it should build without any issues. Please let others know in the comment section below if this solution works for you, so they can avoid looking further! Thanks.

Nguyen

I write two things here: notes from a homelab that mostly runs Proxmox, and essays in Vietnamese about a country I left. The technical posts are whatever broke that week, written down so it costs you less time than it cost me.

All posts →

Leave a comment

Comments are reviewed before they appear. Your email is never published.