Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Path "/ngsw-config.json" already exists

I have created a new angular project. Then I add

ng add @angular/pwa I got an error like this even I can't find the ngsw-config.json file

Path "/ngsw-config.json" already exist.

In angular CLI version is 6.1.1.

Invalid rule result: Function().

In angular CLI version is 6.0.3

like image 928
Pooja Patel Avatar asked Nov 29 '22 08:11

Pooja Patel


2 Answers

I had the same issue. I came from Angular 5 and updated to Angular 6.

I use these specific versions to get it work:

npm install --save @angular/[email protected]

npm install --save @angular/[email protected]

And I had also to remove this entry from angular.json:

"ngswConfigPath": "src/ngsw-config.json"
like image 24
sksvenson Avatar answered Dec 06 '22 11:12

sksvenson


Try to install the CLI version 6.0.8 and then install in a clean project try ng add @angular/[email protected]

Seems like the error hasn't been solved by the core team so in the meanwhile we have to use a lower version

like image 149
Jesus Sandrea Avatar answered Dec 06 '22 11:12

Jesus Sandrea