find and solve || findandsolve.com
Please wait.....

Update all outdated Angular packages at once

Update all outdated Angular packages at once

I want to update my angular version 8.0 to version 12.0.When i have run command 'ng update' the issue has been occured as given below.

PS E:\Running Project\HH\HH\HH\ClientApp> ng update

Using package manager: 'npm'

Collecting installed dependencies...

Found 38 dependencies.

    We analyzed your package.json, there are some packages to update:

      Name Version Command to update

     ---------------------------------------------------------------------------------------

      @angular/cli 8.3.29 -> 11.2.5 ng update @angular/cli

      @angular/core 8.2.14 -> 11.2.6 ng update @angular/core

      @nguniversal/aspnetcore-engine 8.1.1 -> 8.2.6 ng update @nguniversal/aspnetcore-engine

      rxjs 6.6.3 -> 6.6.6 ng update rxjs

    There might be additional packages which don't provide 'ng update' capabilities that are outdated.

    You can update the additional packages by running the update command of your package manager.

PS E:\Running Project\HH\HH\HH\ClientApp>

there might be additional packages which don't provide 'ng update' capabilities that are outdated. you can update the additional packages by running the update command of your package manager.Then run ng update command.We analyzed your package.json, there are some packages to update: 12.0.0 ng update @angular/core There might be additional packages which don't provide 'ng update' capabilities that are outdated. You can update the addition packages by running the update .

Answer

Option 1.

ng update | awk -v re='@[[:alnum:]]' '$0 ~ re {printf $1 " "}' | xargs ng update --force=true && npm update

or in some case this is working fine

ng update @angular/core --force

Option 2.

If you want to update multiple packages at once you can use

ng update <pkg1> <pkg2> <pkg3>

Option 3.

CLI to v8.2.14 and v8.3.19 respectively using the following command:

ng update @angular/cli @angular/core

Mahira  khanna

Mahira khanna

I have the skills you need for you company blog, website, or other content materials

Comments



Report Response