What exactly does `nuxt update` do?
I know obviously that it "updates nuxt dependecy" but I'm curious why the docs recommend running the
nuxi update
command vs just updating the reference in your package.json.
The real reason I ask is that I have a monorepo with multiple separate nuxt apps and I'd like to be able to leverage pnpm catalogs to keep dependencies in sync across the apps.3 Replies
Hi @josepher. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The command you’re referring to is actually
-
nuxt upgrade
, not nuxt update
or nuxi update
. According to the official Nuxt documentation, the nuxt upgrade
command upgrades Nuxt to the latest version. It can be run via npx, yarn, pnpm, or bun, and it offers options to control the working directory, log level, deduplication, force upgrade (which recreates the lockfile and node_modules), and even lets you choose between the stable or nightly release channels. For example:
This command automates the process of updating the Nuxt dependency and can also handle related tasks like deduplication and lockfile management, which is more robust than just manually changing the version in your package.json
and running your package manager. It ensures that all related dependencies are properly updated and that your project is in a consistent state. This is why the docs recommend using the command rather than a manual update—it reduces the risk of version mismatches or missed steps, especially as Nuxt evolves and adds new features or migration requirements nuxt upgrade command.
For monorepos, especially with pnpm, you can still use your pnpm workspace tools to keep dependencies in sync. The nuxt upgrade
command is just a convenience for updating Nuxt itself and handling any related migration steps, but you can continue to use pnpm catalogs or workspace commands to manage versions across multiple apps if that fits your workflow better.
If you want to use the nightly release channel or test new features, the docs also describe how to opt in by changing the Nuxt dependency in your package.json
and reinstalling dependencies Nightly Release Channel.
In summary:-
nuxt upgrade
automates updating Nuxt and related tasks.
- It’s recommended for safety and convenience, but not strictly required if you have your own dependency management strategy in a monorepo.
- For monorepos, you can use pnpm catalogs as usual, but may still find nuxt upgrade
useful for individual app upgrades or migrations.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@146836496240869377> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
It ensures that all related dependencies are properly updated and that your project is in a consistent state.What does this mean in practical terms, like, what steps does nuxi take to ensure this?, and is there a way to run this "manually/on demand".