Migration-Related Notes: Nx 9 -> Nx 10 -> Nx 11
See original GitHub issueFolks, migrating workspaces is hard. Every workspace is different, with different combinations of versions, packages, package managers etc… Also, every workspace evolves differently: as you migrate from version to version, you make small changes making your workspace unique.
Please read the following to learn about the migrate command: https://nx.dev/workspace/update.
To reiterate a few things from the doc:
Important: Use Latest Version of Migration Logic
- If you are on the latest Nx 10 or Nx 11, we will automatically use the latest version of the migration logic to update your workspace. There is nothing you need to do.
If you aren’t on the latest 10x or 11x:
- If you are on the earlier version of Nx and you are using npm 6 (or yarn, pnpm), you have to do it yourself by running
npx @nrwl/tao@latest migrate latest
. - NPM 7 broke npx, so
npx @nrwl/tao@latest migrate latest
won’t work. So you have to manually update the version of@nrwl/tao
in yourpackage.json
tolatest
(or latest 10x) and then runnpx nx migrate latest
. - If you are seeing
Cannot find module '@angular-devkit/architect'
, you are an unlucky person who is using Nx 10.4.11. I–Victor Savkin–screwed up that patch release. I’m sorry about this. Runnx migrate 10.4.12
, runnpm/yarn/pnpm install
, which will fix it, and then follow the instructions above.
One Major at a Time
It’s easier to migrate one major version at a time. If you want to migrate from 9x to 11x (latest), you could run:
> npx @nrwl/tao@latest migrate latest
For most workspace it will work, but for some it won’t. In this case run:
> npx @nrwl/tao@latest migrate 10.4.12 (do the whole migration process to 10x). See instructions above for npm 7 users.
> nx migrate atest (do the whole migration process to 11x)
If You Use Angular, Don’t Use Ng Update
Please read https://nx.dev/latest/core-concepts/updating-nx to see why nx migrate
is a more reliable way to migrate your workspace. \
We Can Help
If you see an exception while migrating, file an issue. Troubleshooting migration-related issues tends to be challenging, but we will do our best to unblock you.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:11 (4 by maintainers)
nx migrate latest
I’m not getting the latest version of Angular.Also: https://nx.dev/workspace/update is redirecting to nx.dev
@vsavkin & Nrwl Just stopped by to say that you guys are great. Thank you for all your hard work on Nx tools. Let the next year be rock solid for all frontend communities that you support: Angular, React, Vue and, of course, Nx itself. Take a break, and enjoy holiday time!