解决sass-loader和node-sass版本冲突问题

我的解决方案:
执行以下脚本:

npm uninstall sass-loader node-sass
npm install sass-loader@8.0.2 sass@1.26.5 --save-dev
不要安装node-sass,安装sass就可以了,package.json如下:
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^7.15.0",
// 这两个是重点:sass、sass-loader
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
},

posted @ 2022-07-19 20:14  chenguiya  阅读(553)  评论(0编辑  收藏  举报