← 输入框|github.com|刷新
Skip to content

angular cli update issue on local folder #4653

Closed

Description

@ashjha

After updating angular cli as mention on github

Global package:

npm uninstall -g angular-cli @angular/cli
npm cache clean
npm install -g @angular/cli@latest

Local project package:

rm -rf node_modules dist # use rmdir on Windows
npm install --save-dev @angular/cli@latest
npm install
ng update

Running ng update will check for changes in all the auto-generated
files created by ng new and allow you to update yours. You are offered
four choices for each changed file: y (overwrite), n (don't
overwrite), d (show diff between your file and the updated file) and h
(help).

when i do ng update ???

demo@VSS-DT0094:~/Desktop/project-dev/client$ ng update
installing ng2
? Overwrite README.md? (yndH) y
>> Yes, overwrite

what to do next if i press Enter

it comes like this

demo@VSS-DT0094:~/Desktop/project-dev/client$ 

and doing again ng update

same result show

demo@VSS-DT0094:~/Desktop/project-dev/client$ ng update installing ng2
? Overwrite README.md? (yndH) y

Activity

  1. stevie6410 commented on Feb 13, 2017

    @stevie6410

    Hi, I am getting this issue too. Have cleared and re-installed my node modules but the 'ng update' command only checks the Readme.md file and then finishes.

  2. Headcult commented on Feb 13, 2017

    @Headcult

    Same issue here. Waiting for a fix for this.

  3. bitconym commented on Feb 13, 2017

    @bitconym

    Same issue here, I think something is broken in the latest angular-cli version 1.0.0-beta.31.

  4. stevie6410 commented on Feb 13, 2017

    @stevie6410

    Having said that, at least the recompile and browser refresh is working okay. Seems to be faster too 👍

  5. Headcult commented on Feb 13, 2017

    @Headcult

    It looks like they are removing 'ng update and 'ng init' going forward as all new CLI changes are backward compatible from now, as per this comment on a similar issue on this: https://github.com/angular/angular-cli/issues/4584#issuecomment-279273790

    #4584

  6. randyaa commented on Feb 13, 2017

    @randyaa

    If they're removing it that's unfortunate, one of the biggest things for me was the init / update commands as it helped us stay in sync with the current templates/blueprints. I thought one of the goals was that those commands would get better and help us satisfy breaking changes in angular itself going forward?

  7. Meligy commented on Feb 13, 2017

    @Meligy
    Contributor

    The command is going away as going forward the team wants to have very little to no breaking changes at all between Angular Cli v1.0 final and v2.0 final. It's already gone in master.

    The current way of replacing files is considered confusing by the team because it involves default empty files that you probably don't want to replace like app module / component, and mess with package.json / angular-cli.json etc.

    It will be rewritten in a smarter way in v2.0 final.

  8. bastibense commented on Feb 14, 2017

    @bastibense

    Can confirm this is not working anymore in beta 31. Works fine in beta 30.

  9. ukaaa commented on Feb 15, 2017

    @ukaaa

    How can I update a project now that ng update doesn't work?

  10. stevie6410 commented on Feb 15, 2017

    @stevie6410

    Yes, it would be nice if we can get the documentation updated to reflect this change and what the process would be until the fancy new v2 method comes along. I am not familiar with all the cli dependencies and wouldn't know what versions they should all be at to ensure they work together.

    Although I guess I could just ng new a project, merge the package.json changes manually and then delete the new project?

  11. ukaaa commented on Feb 15, 2017

    @ukaaa

    I've installed v1.0.0-beta.30 for now like @bastibense suggested.

  12. tomwanzek commented on Feb 16, 2017

    @tomwanzek

    Ran into the same issue with beta.31. If ng update/ng init are no longer supported (at least during and interim period), it raises the question about differing pre-upgrade starting points.

    My angular-cli-based projects do not all have the same pre-update cli version (I would mostly migrate from beta.26) .

    I.p., if beta.30 was the last one to support the "traditional" migration approach, it seems I am now forced to

    • install beta.30 globally first,
    • migrate all of them to beta.30 using the traditional approach,
    • install beta.31,
    • migrate all apps manually using CHANGELOG installation instructions.

    Is this really the suggested approach?

  13. bastibense commented on Feb 17, 2017

    @bastibense

    I ended up creating a blank project from the base-app template repository (the one I assume the init script will clone as a basis). Then I diffed the package.json by hand to make the required adjustment.
    IMHO the helper steps and automatic diffs were something I considered as a big feature of angular-cli, as it doesn't seem overly complex and solves the problem. On the other hand I understand that using a new versioning approach or release strategy reduced the need to do this manual updating all the time.
    We'll see.

  14. ukaaa commented on Feb 20, 2017

    @ukaaa

    I did the same as @bastibense. So far so good. It's really annoying though and I hope this is not the new flow to update existing projects. I know it's still in beta but you can't expect users to only make new projects with Angular CLI. Some of us have existing projects we want to keep as much in sync as possible with the latest Angular version.

  15. filipesilva commented on Mar 9, 2017

    @filipesilva
    Contributor

    We're removed ng update/init and added an explicit upgrade doc for RCs that we're keeping updated: https://github.com/angular/angular-cli/wiki/stories-rc-update

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

  17. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions