qq_43171735
ODBRM
2020-04-17 19:31
采纳率: 100%
浏览 2.2k

Uni-app sass无法编译成css,sass-loader错误

winodws平台下的uni-app项目,在使用了sass后模块无法加载,换成HbuilderX安装插件也不能运行。
求救!

19:20:36.861 Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
19:20:36.862 ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
19:20:36.875 SassError: Invalid argument(s): Unsupported output style "nested".
19:20:36.876     at runLoaders (C:\Users\WI\Downloads\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\NormalModule.js:301:20)
19:20:36.890     at C:\Users\WI\Downloads\HBuilderX\plugins\uniapp-cli\node_modules\loader-runner\lib\LoaderRunner.js:367:11
19:20:36.890     at C:\Users\WI\Downloads\HBuilderX\plugins\uniapp-cli\node_modules\loader-runner\lib\LoaderRunner.js:233:18
19:20:36.900     at context.callback (C:\Users\WI\Downloads\HBuilderX\plugins\uniapp-cli\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
19:20:36.900     at render (C:\Users\WI\Downloads\HBuilderX\plugins\uniapp-cli\node_modules\sass-loader\dist\index.js:73:7)
19:20:36.914     at Function.call$2 (C:\Users\WI\node_modules\sass\sass.dart.js:54311:16)
19:20:36.915     at _render_closure1.call$2 (C:\Users\WI\node_modules\sass\sass.dart.js:33511:12)
19:20:36.933     at _RootZone.runBinary$3$3 (C:\Users\WI\node_modules\sass\sass.dart.js:19817:18)
19:20:36.934     at _RootZone.runBinary$3 (C:\Users\WI\node_modules\sass\sass.dart.js:19821:19)
19:20:36.955     at _FutureListener.handleError$1 (C:\Users\WI\node_modules\sass\sass.dart.js:18286:19)
19:20:36.956     at _Future__propagateToListeners_handleError.call$0 (C:\Users\WI\node_modules\sass\sass.dart.js:18574:40)
19:20:36.970     at Object._Future__propagateToListeners (C:\Users\WI\node_modules\sass\sass.dart.js:3484:88)
19:20:36.971     at _Future._completeError$2 (C:\Users\WI\node_modules\sass\sass.dart.js:18410:9)
19:20:36.990     at _Future__asyncCompleteError_closure.call$0 (C:\Users\WI\node_modules\sass\sass.dart.js:18500:18)
19:20:36.990     at Object._microtaskLoop (C:\Users\WI\node_modules\sass\sass.dart.js:3534:21)
19:20:37.009     at StaticClosure._startMicrotaskLoop (C:\Users\WI\node_modules\sass\sass.dart.js:3540:11)
19:20:37.010  ERROR  Build failed with errors.
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • Nancy_959
    Nancy_959 2020-04-23 16:16
    已采纳

    sass模块经常下的时候回出错
    npm install node-sass --save-dev
    npm install sass-loader --save-dev
    这两个模块都要装,如果还是不行,试试用cnpm装

    点赞 评论
  • qq_53434555
    qq_53434555 2021-04-07 14:19

    全局安装,还是在运行项目下安装

     

     

     

    点赞 评论
  • qq_43171735
    ODBRM 2021-04-13 16:21

    问题解决方法是下调sass-loader版本,下调到7.0版本后正常

    点赞 评论

相关推荐