angular-cli: ng update / init broken on an existing project since beta.31
OS
Mac OSX Sierra
Versions.
@angular/cli: 1.0.0-beta.31
node: 6.9.5
Repro steps.
During the update from beta.30
to beta.31
, running ng update
or ng init
exits after asking me to overwrite README.md
… No matter what option i choose, it just quits straight away without continuing further.
The log given by the failure.
$ ng update
installing ng2
? Overwrite README.md? Diff
$
$ ng update
installing ng2
? Overwrite README.md? Diff
$
$ ng update
installing ng2
? Overwrite README.md? Yes, overwrite
$
$ ng init
installing ng2
? Overwrite README.md? Diff
$
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 29
- Comments: 26 (13 by maintainers)
With ng update if you had your project under source control it was easy to update. Let ng update replace all files then with a git gui compare the changes and take the new ones that you want or leave your unchanged files. Not sure if this was the correct workflow but seemed to work pretty well.
Unless I am missing something, I think I tried
ng init
/ng update
in a beta.30 CLI project on Windows, I didn’t havereadme
in that project so the file it asked to replace was different (I think it wasindex.html
), then it just ended. I looked at my git and found that the files were changed, and I was able to upgrade my project.In saying this, I’m agreeing with @splintercode, the way I update my projects is by running
ng init
, accepting all core files (tslint, tsconfig, editorconfig, test.ts, karma.conf.js, package.json, polyfills, main.ts, etc.) and then going to git to undo the changes I don’t want.Now it seems that the command is misleading, because it brings default files even to app module / component etc. I agree, but I think this has largely increased by calling it
ng update
. It was more predictable and making more sense to have these effects when it was calledng init
.The reasoning I was given for removing the tool and resorting to changelog instead is that the team expects no changes to these core files (or very minimal) after v 1.0 final - I honestly don’t know what to think of this reasoning, as good or bad. It looks like this command is going away a tiny bit earlier than that anyway.
@victornoel no workaround per se. Moving forward, all changes that require user project changes should be in https://github.com/angular/angular-cli/blob/master/CHANGELOG.md
Ironically enough, the single change that needed users to update code was left out of the changelog by accident. You can find it here: https://github.com/angular/angular-cli/pull/4587/files
Other than that, to update now you should just need to follow the steps in https://github.com/angular/angular-cli#updating-angular-cli except for
ng update
.We’ll remove those commands and the instructions soon.
I’ll reopen this issue though, a lot of people are running into the problem so it’s more visible open.
Right you are @jtsom!
in my case first question was
.editorconfig
and exited right after answer given. Windows 10 64 bit Node 7.5.0 npm 4.1.2@shiftgeist yes, that site is up to date.
I agree with @splintercode, having to check the changelog to find and apply the minutiae that changed manually every time the CLI updates seems like a step backward.
Shouldn’t those new instructions for the changes to Karma include the --save-dev flag?
To update follow these steps in your project:
npm uninstall karma-remap-istanbul --save-dev
npm install karma-coverage-istanbul-reporter --save-dev
I’ve created a folder in the past where I add new dummy project each time a new version of Angular-Cli rolls out. Then copy over files to previous one’s folder and see changes on git gui.
@filipesilva so what is the workaround for everybody that can’t call ng update with beta.31?