【Module build failed (from ./node_modules/sass-loader/dist/cjs.js):】

@[TOC](Module build failed (from ./node_modules/sass-loader/dist/cjs.js):)

An error was reported when running a new project. After researching for a long time, the main report was Module build failed (from ./node_modules/sass-loader/dist/cjs.js):

insert image description here
You can npm uninstall sass-loader and npm uninstall node-sass, and install npm install sass-loader and node-sass because the version of sass-loader is only suitable for relative nodejs

Note that it is very likely to report an error when installing the latest version. If you cannot start the project, you need to specify the version of node-sass and sass-loader

Currently my project uses

npm i node-sass@4.14.1 
npm i sass-loader@7.3.1 --save-dev

If your nodejs is a different version, there may be changes

Guess you like

Origin blog.csdn.net/qq_39236283/article/details/131082313