Upgrade Angular version (now: 2.4.3 or 4.0.0-beta.3) following the best practice?

后端 未结 3 1576
鱼传尺愫
鱼传尺愫 2021-02-05 22:48

Now that Angular is following a Semantic Versioning, and Angular2.4.3 were released, I\'m a little confused here on what is the best practice when I upgrade to the next Angular

相关标签:
3条回答
  • 2021-02-05 23:28

    I suggest you install npm-check-updates library. This will let you find the latest version of dependencies, which you use.

    Follow the steps:

    1. To install

      npm i -g npm-check-updates


    1. To update your package.json:

      npm-check-updates -u


    1. To install latest versions your dependencies

      npm install

    0 讨论(0)
  • 2021-02-05 23:34

    I've upgraded my app from Angular 2.4.0 to 4.0.2 without any code changes! Bare in mind, though that it depends of which features/classes/methods you are using.

    I ran

    npm i @angular/common@latest @angular/compiler@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest typescript@latest --S -E
    

    then

    npm i @angular/compiler-cli@latest --D -E
    

    NOTE: use @latest if you want the latest stable version. Use @next if you want the latest 'bleeding edge' version.

    0 讨论(0)
  • 2021-02-05 23:38

    For Windows You can use the below command

    npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest --save
    
    0 讨论(0)
提交回复
热议问题