vue 使用scss报错
安装sass-load和node-sass
npm install sass-loader --save-dev
npm install node-sass --save

在webpack.base.conf.js中配置好了

然后发现报错了

(node:2532) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either byrRunner.js:119:14) throwing inside of an async function without a catch block, or by rejecting a promise which was not handlunner.js:120:4)ed with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandoaderRunner.js:232:2)led-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) m.js:70:14
(node:2532) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, prom throwing inside of an async function without a catch block, or by rejecting a promise which was not handledise rejections that are not handled will terminate the Node.js process with a non-zero exit code. d-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
34% building modules 208/209 modules 1 active …tasay-user-center\src\layout\Home.vue
上网查询后发现是兼容性问题
安装低版本的sass-load和node-sass即可
npm install sass-loader@7.3.1 --save-dev
npm install node-sass@4.0.0 --save
再次npm run dev即可


在Vue项目配置Webpack后,遇到Scss编译报错,错误提示涉及UnhandledPromiseRejectionWarning和DeprecationWarning。问题根源是兼容性问题,通过降级sass-loader和node-sass到合适版本来解决。完成依赖更新后,重新运行npm run dev,项目恢复正常。
5534

被折叠的 条评论
为什么被折叠?



