Skip to content

generate bails when overwriting files #4614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
delasteve opened this issue Feb 11, 2017 · 2 comments · Fixed by #5218
Closed

generate bails when overwriting files #4614

delasteve opened this issue Feb 11, 2017 · 2 comments · Fixed by #5218

Comments

@delasteve
Copy link
Contributor

delasteve commented Feb 11, 2017

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.

@zahlprish
Copy link

zahlprish commented Feb 13, 2017

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.

delasteve added a commit to delasteve/angular-cli that referenced this issue Mar 4, 2017
delasteve added a commit to delasteve/angular-cli that referenced this issue Mar 4, 2017
delasteve added a commit to delasteve/angular-cli that referenced this issue Mar 4, 2017
delasteve added a commit to delasteve/angular-cli that referenced this issue Mar 6, 2017
delasteve added a commit to delasteve/angular-cli that referenced this issue Mar 8, 2017
Brocco pushed a commit that referenced this issue Mar 8, 2017
* fix(@angular/cli): fix issue with console prompt bailing early

fixes #4614

* fix(@angular/cli): fix declarable types not finding closest module

fixes #5127
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this issue Apr 12, 2017
…ar#5218)

* fix(@angular/cli): fix issue with console prompt bailing early

fixes angular#4614

* fix(@angular/cli): fix declarable types not finding closest module

fixes angular#5127
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants