升级node-sass,运行报错

来源:2-3 项目基础代码编写

天际划过的流星雨

2021-12-13

node有版本要求么?为什么我一升级node-sass版本就开始报错,运行不起来
Syntax Error: Error: PostCSS received undefined instead of CSS string

@ ./src/assets/scss/index.scss 4:14-234 15:3-20:5 16:22-242
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.0.102:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

error in ./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=scss

Syntax Error: Error: PostCSS received undefined instead of CSS string
at runMicrotasks ()

@ ./node_modules/vue-style-loader??ref–9-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref–9-oneOf-1-1!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!./node_modules/postcss-loader/src??ref–9-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref–9-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref–1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref–1-1!./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=scss 4:14-479 15:3-20:5 16:22-487
@ ./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=scss
@ ./src/App.vue
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.0.102:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

写回答

2回答

慕尼黑8232388

2022-02-04

请问楼主解决了吗 我也是同情况卡住了

0
1
天际划过的流星雨
node版本16.13.1 用sass代替node-sass 先卸载已安装的node-sass sass-loader,在执行命令 npm install sass-loader@10.1.1 -D npm install sass -D
2023-01-20
共1条回复

ustbhuangyi

2021-12-14

node 版本不能太低,建议 14+,然后安装到课程视频说的版本

0
0

Vue3开发企业级音乐Web App 明星讲师带你学大厂代码

慕课网明星讲师黄轶深度讲解 Vue3.0 ,提升的不止是Vue代码能力

2223 学习 · 1002 问题

查看课程