Skip to content

generate bails when overwriting files #4614

Closed

Description

@delasteve

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

macOS El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

@angular/cli: 1.0.0-beta.31
node: 6.9.5
os: darwin x64
@angular/common: 2.4.7
@angular/compiler: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.4.7
@angular/http: 2.4.7
@angular/platform-browser: 2.4.7
@angular/platform-browser-dynamic: 2.4.7
@angular/router: 3.4.7
@angular/cli: 1.0.0-beta.31
@angular/compiler-cli: 2.4.7

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

ng new foo
ng g m bar
ng g m bar --routing

The log given by the failure.

Normally this include a stack trace and some more information.

foo (master*) » ng g m bar
installing module
  create src/app/bar/bar.module.ts
foo (master*) » ng g m bar --routing
installing module
? Overwrite src/app/bar/bar.module.ts? Yes, overwrite

Mention any other details that might be useful.

I would expect the file to be overwrote to enable routing. I would also expect to have other files to be generated that would have been generated using ng g m bar --routing.


Thanks! We'll be in touch soon.

Activity

  1. zahlprish commented on Feb 13, 2017

    @zahlprish

    I believe I am running into something similar when I updated to @angular/cli: 1.0.0-beta.31. It "seems" the cli thinks it is install globally, ie: if i create a new empty folder on my desktop and run "ng new testapp": I get the message "You cannot use the new command inside an Angular CLI project.". Now this is a brand new empty folder.

    When I go back to my previously working angular app, run the angular-cli upgrade and I run "ng update" I get:

    ng update
    installing ng2
    ? Overwrite README.md? (yndH) 
    

    When I hit any of the buttons, nothing happens and the process just seems to fail silently. No error messages.

    My ng --version:

    @angular/cli: 1.0.0-beta.31
    node: 7.4.0
    os: darwin x64
    @angular/common: 4.0.0-beta.7
    @angular/compiler: 4.0.0-beta.7
    @angular/core: 4.0.0-beta.7
    @angular/forms: 4.0.0-beta.7
    @angular/http: 4.0.0-beta.7
    @angular/platform-browser: 4.0.0-beta.7
    @angular/platform-browser-dynamic: 4.0.0-beta.7
    @angular/router: 3.4.7
    @angular/material: 2.0.0-beta.1
    @angular/cli: 1.0.0-beta.31
    @angular/compiler-cli: 4.0.0-beta.7
    

    Update:
    Disregard my above comments... What I discovered was that I had a package.json file laying on my desktop that was getting picked up within the folder.

    My problems appear to be all fixed. On a side note, I utilized the ng new angular --ng4 on @angular/cli: 1.0.0-beta.31, migrated all of my stuff over to this install and everything is working as expected.

  2. added a commit that references this issue on Mar 8, 2017
    3515c3b
  3. added a commit that references this issue on Apr 12, 2017
    cd69373
  4. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  5. locked and limited conversation to collaborators on Sep 6, 2019
  6. added a commit that references this issue on May 29, 2026
    2994684
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions