question:
The error message indicates that node-sass does not match the node.js version of the current environment. My node js version here is 14.15.0
When I started to use the yarn command to install all dependencies, it also reported an error, which also prompted a version issue. Later I found that the node.js 14.15.0 version was actually fine.
Solution one
-
First remove "node-sass" and "sass-loader" in package.json (in devDependencies)
-
Install all dependencies yarn or npm install
-
Reinstall node-sass and sass-loader separately,
yarn add node-sass^4.14.1 -D or npm install node-sass ^4.14.1 -D;
yarn add sass-loader^7.3.1 -D or npm install sass -loader^7.3.1 -D
Option II
Lower the version of node.js and do not use node version 16 or above.