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

Angular 18 Material3自定义主题生成报错排查与解决

Angular 18 Material 3 主题生成报错:"Cannot parse the specified color undefined" 解决方法

问题详情

  • 环境配置:Angular 18.0.0 + 基于Material 3设计规范的Material库
  • 执行的主题生成命令:ng generate @angular/material:m3-theme
  • 触发报错:

    Cannot parse the specified color undefined. Please verify it is a hex color (ex. #ffffff or ffffff).

  • 无效尝试:尝试通过--color、--c、--colour参数传递基础颜色,均未解决问题,且官方文档无对应示例。

解决方案

该问题源于Windows系统下Git Bash与Angular Material原理图的兼容性问题,只需改用Windows命令提示符(CMD)或PowerShell执行原命令,即可正常进入交互式主题配置流程,无需额外传递颜色参数。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.23 12:35:57