angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

generate bails when overwriting files

Open delasteve opened this issue 9 years ago • 2 comments

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.

delasteve avatar Feb 11 '17 07:02 delasteve

~~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.

zahlprish avatar Feb 13 '17 05:02 zahlprish

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.