未知选项:'--service-worker' 创建新的 angular pwa

Unknown option: '--service-worker' creating new angular pwa

我正在尝试创建一个新的 angular PWA,但是当我执行 ng new pwa --service-worker 系统时 returns 未知选项:'--service-worker '

知道哪里出了问题吗?

--service-worker 选项仅适用于 ng build command

您可以通过 运行 常规 ng new command followed by an ng add command 生成 PWA。

ng new pwa
ng add @angular/pwa --project pwa