请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

升级node-sass,运行报错

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

正在回答 回答被采纳积分+3

2回答

慕尼黑8232388 2022-02-04 02:52:45

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

0 回复 有任何疑惑可以回复我~
  • 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 20:10:11
ustbhuangyi 2021-12-14 21:56:56

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

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信