1

I am trying to run simple component generate command which is throwing error like this:

command:

sudo ng generate component forgot-pass

Error Msg:

Path "/src/app/forgot-pass/forgot-pass.component.css" already exist.

I am clueless about this error, my application is building properly and when check there is not a single folder or file like this.

If I put anything istead of forgot-pass, it throws the same error.

FYI, here is the version my cli is using:

    _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 6.0.1
Node: 8.11.2
OS: darwin x64
Angular: 6.0.2
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.1
@angular-devkit/build-angular     0.6.1
@angular-devkit/build-optimizer   0.6.1
@angular-devkit/core              0.6.1
@angular-devkit/schematics        0.6.1
@angular/animations               6.1.2
@angular/cli                      6.0.1
@ngtools/webpack                  6.0.1
@schematics/angular               0.6.1
@schematics/update                0.6.1
rxjs                              6.2.0
typescript                        2.7.2
webpack                           4.6.0
2
  • what is the angular cli version Commented Oct 6, 2018 at 6:34
  • Edited the question Commented Oct 6, 2018 at 6:36

1 Answer 1

2

This seems to be a known issue with that version of angular cli due to some files were created twice. probably what you can do is to create a new app.

You can resolve this by updating your angular cli version sudo npm update @angular/cli latest

Sign up to request clarification or add additional context in comments.

4 Comments

My project grown a bit big I can't do with new project, can I update angular CLI instead?
Please edit the answer as alternate to this. I did sudo npm update @angular/cli latest and that worked for me
thats what i already mentioned in the answer. anyway i will update

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.