Solution to error when starting vue project in ./src/App.vue?vue&type=style&index=0&lang=scss

It's really disgusting that this problem occurs. The reason is the compatibility issue with low version. I spent a whole morning trying to summarize the most practical method and record it here.

The first step is to uninstall sass-loader

npm uninstall sass-loader

If the uninstallation also reports an error, execute the following code

npm uninstall node-sass

npm uninstall sass-loader

The second step is to install a [email protected] and [email protected] version

npm install sass@1.26.5 --save-dev
npm install sass-loader@7.0.0 --save-dev

Finally, to install a lower version of sass-loader, you need to introduce node-sass dependency for support. Please execute the following code

npm install node-sass

ps It is best to use the installation environment that comes with VsCode

Guess you like

Origin blog.csdn.net/weixin_46533797/article/details/125909066