---
title: "nuxt cleanup"
description: "Remove common generated Nuxt files and caches."
canonical_url: "https://nuxt-git-fix-sanitize-data-nuxt-js.vercel.app/docs/4.x/api/commands/cleanup"
---
# nuxt cleanup

> Remove common generated Nuxt files and caches.

<!--cleanup-cmd-->

```bash [Terminal]
npx nuxt cleanup [ROOTDIR] [--cwd=<directory>]
```

<!--/cleanup-cmd-->

The `cleanup` command removes common generated Nuxt files and caches, including:

- your build directory, which is `.nuxt` unless [`buildDir`](https://nuxt-git-fix-sanitize-data-nuxt-js.vercel.app/docs/4.x/api/nuxt-config#builddir) says otherwise
- `.output`
- `dist`
- `node_modules/.vite`
- `node_modules/.cache`

## Arguments

<!--cleanup-args-->

| Argument             | Description                                          |
| -------------------- | ---------------------------------------------------- |
| `ROOTDIR`            | The root directory of your Nuxt project (default: .) |
| <!--/cleanup-args--> |                                                      |

## Options

<!--cleanup-opts-->

| Option               | Default | Description                                     |
| -------------------- | ------- | ----------------------------------------------- |
| `--cwd=<directory>`  |         | Specify the root directory of your Nuxt project |
| <!--/cleanup-opts--> |         |                                                 |

---

- [Source](https://github.com/nuxt/cli/blob/main/packages/nuxt-cli/src/commands/cleanup.ts)


## Sitemap

See the full [sitemap](https://nuxt-git-fix-sanitize-data-nuxt-js.vercel.app/sitemap.md) for all pages.
