Installing node-sass conflicts with node js

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

  1. First remove "node-sass" and "sass-loader" in package.json (in devDependencies)
    Insert image description here

  2. Install all dependencies yarn or npm install

  3. 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.

Guess you like

Origin blog.csdn.net/qq_45331969/article/details/123739669