Sometimes you need the very latest version of Angular and but a migration configuration is not yet available.
For instance, let's say Angular 17.1 is released on January 17, 2024, but as of today (January 22), the last available version according to the Angular and Nx Version Matrix is:
Angular Version Nx Version
~17.0.0 17.1.0 <= latest
Maybe you have already used these commands (as recommended by Nx):
# Update Nx to the latest version
nx update @nrwl/workspace
# Migrate Nx to the latest version
nx migrate latest
# If migration.json is created
nx migrate --run-migrations=migrations.json
# Update all packages to the latest version
npm install
And this process has updated your setup to version 17.0.0, but want to use Angular 17.1 (the latest possible version) immediately.
In this scenario, you might try:
npx npm-check-updates -u
npm i --legacy-peer-deps
The first command updates your package.json
to the latest package versions, while the second command takes care of installing the updates, respecting the necessary peer dependencies.
Using --legacy-peer-deps
can help you out, by bypassing the peer deps auto-installation. It is particularly useful when dealing with version mismatches or unmeet peer dependencies.
But there is no guarantee, that can work so in each time. Better use a versioning system (e.g. git) before you try to do so.
p.s. I could successfully upgrade to Angular 17.1 today.
nx migrate 14
will migrate to nx14 which (according to the combat-matrix uses ng13! So to update to the latest ng 14 you must use nx14.6.0 <= nx15.1.1: e.g.nx migrate 15.1.1
worked for me to update my workspace to nx15.1.1 and ng14 – Thorwald