[Solved] How to fix this node-sass build error on Netlify?

Vue JS Mohaimen Khalid

Solution:

Sometimes we try to deploy our vuejs project on Netlify and get an error with node-sass. Now we try to discuss why this error occurred. 

Firstly, check the Netlify environment running node version. Ok, I checked my node version and my node version is v16.0 +, and also my node-sass version is v4.1+. Which is incompatible with the node-sass other dependencies that we used. 

check this list - 


And you can check from here - Node-Sass

You can add to force a node version on your Netlify environment by going to "Deploy Settings" > "Environment" > "Edit variables" and by adding NODE_VERSION = [version ] (for example 14+).

See on - https://docs.netlify.com/configure-builds/manage-dependencies


Another option:

just uninstall node-sass

and then install sass-loader sass

npm uninstall node-sass
npm install sass-loader
npm install sass

Everything works fine! Try to deploy and this time it'll not show the errors.


Thank you for reading the article. If it's helpful to you please share this article with others.