You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Angular 14迁移后ng build报SASS未终止字符串令牌错误求助

Angular 9 迁移至 Angular 14 构建报错:未终止字符串令牌

我们近期将项目从Angular v9迁移至Angular v14,执行ng serve时项目运行正常,但执行ng build构建应用时失败,报错信息如下:

Error: Transform failed with 1 error:
src/app/administration-module/account-settings/add-database-details/add-database-details.component.sass:17:100: ERROR: Unterminated string token

当前使用的SASS代码如下:

.execute-box
  width: 25%
  position: fixed
  right: 0
  top: 65px
  background: white
  border: 1px solid black
  overflow-y: scroll
  //bottom: 64px
  box-shadow: 0 24px 24px 0 rgba(0, 0, 0, 0.39)
  border: solid 1px #c8c8c8
  background-color: #ffffff

.custom-checkbox .custom-control-label::before
  width: 18.6px
  height: 18px
  border-radius: 2px
  border: solid 1px #707070
  background-color: #ffffff

已尝试的解决步骤:

  • 安装/卸载node-sass
  • 按照SASS规范重写报错提及的代码部分(即上述最新代码)
  • 重新安装Node modules
  • 降级/升级node-sass版本

内容的提问来源于stack exchange,提问作者Sainath S

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 00:52:04