nuxt add
Add Nuxt modules and layers to your application.
Terminal
npx nuxt add <MODULENAME...> [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--skipInstall] [--skipConfig] [--dev] [--packageManager=<npm|pnpm|yarn|bun|deno|aube|nub>]
The add command installs Nuxt modules and layers into your application. It is the same command as nuxt module add, with layers included.
Arguments
| Argument | Description |
|---|---|
MODULENAME... | Specify one or more modules or layers to install by name, separated by spaces |
Options
| Option | Default | Description |
|---|---|---|
--cwd=<directory> | . | Specify the root directory of your Nuxt project |
--logLevel=<silent|info|verbose> | Specify build-time log level | |
--skipInstall | Skip npm install | |
--skipConfig | Skip nuxt.config.ts update | |
--dev | Install modules as dev dependencies | |
--packageManager=<npm|pnpm|yarn|bun|deno|aube|nub> | Package manager to install with |
When running the command, it will:
- install the package as a dependency using your package manager, unless you pass
--skipInstall - add it to your
package.jsonfile - register it in your
nuxt.configfile, inmodulesfor a module and inextendsfor a layer, unless you pass--skipConfig
Example:
Terminal
npx nuxt add pinia
Several packages can be added at once, and the modules will be resolved against the Nuxt version your project uses:
Terminal
npx nuxt add @nuxt/image @nuxt/fonts
Run it without a name to browse the available modules interactively.
nuxt add <template> <name> is deprecated. Use nuxt add-template to scaffold files.