0

about this error Angular Generate component through path already exists error

i have the same problem and try to build new app, but after a few days the problem is back, newest versions of npm and angular-cli have the same issue. can anyone help?

Commands:

ng generate component modules/report
ng generate component modules/report --force

Error:

Path "/report/report.component.scss" already exist.

Environment:

Angular CLI: 9.0.7
Node: 12.16.1
OS: linux x64

Angular: 9.0.7
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.7
@angular-devkit/build-angular     0.900.7
@angular-devkit/build-optimizer   0.900.7
@angular-devkit/build-webpack     0.900.7
@angular-devkit/core              9.0.7
@angular-devkit/schematics        9.0.7
@angular/cdk                      9.1.3
@angular/material                 9.1.3
@ngtools/webpack                  9.0.7
@schematics/angular               9.0.7
@schematics/update                0.900.7
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

1 Answers1

0

Try

npm i @angular/cli@latest

After that try your command.

Aakash Garg
  • 10,649
  • 2
  • 7
  • 25