Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm trying to create a new angular PWA, but when I executeng new pwa --service-worker the system returns Unknown option: '--service-worker'

Any idea what's wrong?

  • OS: ubuntu gnome 16.04
  • Node: v10.16.0
  • Npm: 6.9.0
like image 538
Esteben Guio Avatar asked Mar 03 '23 20:03

Esteben Guio


1 Answers

The --service-worker option is only available for the ng build command.

You can generate a PWA by running the regular ng new command followed by an ng add command.

ng new pwa
ng add @angular/pwa --project pwa
like image 129
chrisguttandin Avatar answered Mar 09 '23 00:03

chrisguttandin