Java教程

解决sass-loader和node-sass版本冲突问题(太难了)

本文主要是介绍解决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如下

 

{
"name": "vue3.0-demo-1",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"core-js": "^3.6.5",
"joi": "^17.4.2",
"vue": "^2.6.11"
},
"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"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

这篇关于解决sass-loader和node-sass版本冲突问题(太难了)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!