Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Can‘t find stylesheet

把angular项目从git拉去下拉后,通过npm install @angular/cli@9.1.12安装项目的node_module后,再通过ng serve启动项目时一直报错

报错信息如下:

ERROR in ./src/assets/custom-bootstrap-utilities.scss (./node_modules/css-loader/dist/cjs.js??ref--13-1!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/disets/custom-bootstrap-utilities.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
   ╷
12 │ @import "../../node_modules/bootstrap/scss/_functions.scss";

 

查找资料说是安装node_module时没有使用淘宝镜像,重新使用淘宝镜像安装

npm install node-sass --registry=https://registry.npm.taobao.org

npm install @angular/cli@9.1.12

后启动项目仍然报错,报错信息如下

ERROR in ./src/assets/custom-bootstrap-utilities.scss (./node_modules/css-loader/dist/cjs.js??ref--13-1!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/disets/custom-bootstrap-utilities.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
   ╷
12 │ @import "../../node_modules/bootstrap/scss/_functions.scss";

后又查询信息,需要安装node-sass

pm install -g cnpm --registry=https://registry.npm.taobao.org

cnpm install node-sass

安装sass后仍然报错

Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.

这个信息就很明显了,直接再卸载原先sass重新安装个版本4的sass即可。

npm uninstall node-sass

npm install node-sass@4.14.1

启动项目,successfully.

 

 

 

所以项目一开始就是报SassError,直接安装个npm install node-sass@4.14.1应该就可以了!

98% after emitting CopyPlugin ERROR Failed to compile with 121 errors 下午1:57:47 error in ../workflows/module/workflow/module/workflowModal.vue?vue&type=style&index=0&id=1daa1fe1&lang=scss&scoped=true Syntax Error: <!--新增和导入 二合一弹窗--> ^ Can't find stylesheet to import. ╷ 2 │ @import "@dataspherestudio/shared/common/style/variables.scss"; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ stdin 2:9 root stylesheet in D:\gdongt\packages\workflows\module\workflow\module\workflowModal.vue (line 2, column 9) @ D:/gdongt/node_modules/vue-style-loader??ref--8-oneOf-1-0!D:/gdongt/node_modules/css-loader??ref--8-oneOf-1-1!D:/gdongt/node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/stylePostLoader.js!D:/gdongt/node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-2!D:/gdongt/node_modules/cache-loader/dist/cjs.js??ref--0-0!D:/gdongt/node_modules/vue-loader/dist??vue-loader-options!../workflows/module/workflow/module/workflowModal.vue?vue&type=style&index=0&id=1daa1fe1&lang=scss&scoped=true 4:14-475 15:3-20:5 16:22-483 @ ../workflows/module/workflow/module/workflowModal.vue?vue&type=style&index=0&id=1daa1fe1&lang=scss&scoped=true @ ../workflows/module/workflow/module/workflowModal.vue @ ../workflows/module sync ([a-z|A-Z])+.vue$ @ ./node_modules/dynamic-modules.js @ ./src/dynamic-apps.js @ ./src/main.js @ multi (webpack)-dev-server/client?http://192.168.100.70:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js error in ../dataService/module/dataManagement/apiIndex.vue?vue&type=style&index=0&id=4fda01e9&lang=scss&scoped=true
06-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值