{"id":17043,"library":"nuxi","title":"Nuxt CLI","description":"Nuxi is the official Command Line Interface (CLI) for the Nuxt.js framework, providing essential tools for project initialization, development, building, and management. As of its current stable version 3.34.0, Nuxi maintains a rapid release cadence with frequent minor and patch updates, indicating active development and continuous improvement. It differentiates itself by offering a tightly integrated experience for Nuxt developers, including features like interactive project creation with module selection, shell completions, and simplified command structures for common tasks. Nuxi abstracts away much of the underlying build tool complexity, allowing developers to focus on application logic within the Nuxt ecosystem. It requires Node.js version 16.10.0 or higher, or 18.0.0 or higher.","status":"active","version":"3.34.0","language":"javascript","source_language":"en","source_url":"https://github.com/nuxt/cli","tags":["javascript","typescript"],"install":[{"cmd":"npm install nuxi","lang":"bash","label":"npm"},{"cmd":"yarn add nuxi","lang":"bash","label":"yarn"},{"cmd":"pnpm add nuxi","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The primary and recommended way to use Nuxi for ad-hoc commands is via 'npx', which uses the locally installed version or downloads it temporarily. Global installations are generally discouraged for dev tools.","wrong":"npm install -g nuxi && nuxi <command>","symbol":"nuxi (CLI via npx)","correct":"npx nuxi <command>"},{"note":"For consistent, project-specific execution, define Nuxi commands within your 'package.json' scripts. This ensures the version installed as a dev dependency is always used.","wrong":"\"scripts\": { \"dev\": \"nuxt dev\" }","symbol":"nuxi (package.json script)","correct":"\"scripts\": { \"dev\": \"nuxi dev\", \"build\": \"nuxi build\", \"preview\": \"nuxi preview\" }"},{"note":"While primarily a CLI, Nuxi exposes an internal `runMain` function for advanced programmatic execution, suitable for CI/CD pipelines or custom build tools. The exact import path ('nuxi/dist/shared/nuxi') might be subject to change in future versions as it is an internal API.","wrong":"import nuxi from 'nuxi'; // No default export for a direct programmatic API","symbol":"runMain (programmatic)","correct":"import { runMain } from 'nuxi/dist/shared/nuxi';\n\nasync function executeNuxiCommand() {\n  // Example: Programmatically run 'nuxi build ./path/to/my-project'\n  await runMain(['build', './path/to/my-project']);\n  console.log('Nuxt build completed programmatically.');\n}\n\nexecuteNuxiCommand();"}],"quickstart":{"code":"# Initialize a new Nuxt 3 project in a directory named 'my-nuxt-project'.\n# This command will interactively guide you through setting up project preferences\n# such as package manager, TypeScript support, and common Nuxt modules.\nnpx nuxi init my-nuxt-project\n\n# Navigate into your newly created project directory to continue setup.\ncd my-nuxt-project\n\n# Install the necessary project dependencies using your chosen package manager (e.g., npm, yarn, pnpm).\n# This step fetches all required packages, including Nuxt itself and any modules you selected during initialization.\nnpm install\n\n# Start the Nuxt development server. This command compiles your application\n# and provides hot module reloading, making it easy to see changes instantly.\n# Your application will typically be accessible in your web browser at http://localhost:3000.\nnpm run dev\n\n# After development, you can build your application for production using:\n# npm run build","lang":"bash","description":"Initializes a new Nuxt 3 project with interactive prompts, installs dependencies, and starts the development server, demonstrating the core Nuxi workflow."},"warnings":[{"fix":"Migrate any proxy configurations to external solutions (e.g., `h3-proxy`, `@nuxtjs/proxy` module, or a dedicated reverse proxy like Nginx) or configure Nuxt's server proxy directly if applicable.","message":"Nuxi v3.30.0 removed its built-in proxy server. Projects relying on this internal proxy for API forwarding or similar functionalities during development will now experience failures. Users must implement an alternative proxy solution.","severity":"breaking","affected_versions":">=3.30.0"},{"fix":"Replace `nuxi module add <module-name>` with `nuxi add <module-name>` in all scripts and documentation.","message":"The `nuxi module add` command has been superseded by `nuxi add` in v3.32.0. While the older command might still be recognized for compatibility, it's recommended to update your workflows to use the new, more generalized `nuxi add` command.","severity":"deprecated","affected_versions":">=3.32.0"},{"fix":"Upgrade your Node.js environment to a compatible version using a Node Version Manager (e.g., `nvm install 18` and `nvm use 18`).","message":"Nuxi has strict Node.js engine requirements: `^16.10.0` or `>=18.0.0`. Running Nuxi with unsupported Node.js versions will lead to immediate errors and prevent project operations.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Explicitly define `NODE_ENV` in your `package.json` scripts or `.env` files. Ensure you thoroughly test your application's behavior in development mode if `NODE_ENV` manipulation is critical.","message":"In certain development scenarios, particularly in older versions, Nuxi's development server might override the `NODE_ENV` environment variable. This can lead to unexpected behavior if your application logic depends on a specific `NODE_ENV` value during development.","severity":"gotcha","affected_versions":">=3.0.0 <3.31.3"},{"fix":"Always use the latest stable version of `nuxi` (`npx nuxi upgrade`) to benefit from improved interactive prompts, better error handling, and more refined user experience during project setup and module management.","message":"Early versions of `nuxi init` and `nuxi module add` (before v3.31.3/v3.32.0) had issues with module compatibility filtering and verbose dependency installation logs. This could lead to selecting incompatible modules or a cluttered terminal output.","severity":"gotcha","affected_versions":"<3.32.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Ensure `nuxi` is installed as a dev dependency in your project (`npm install nuxi --save-dev`) and then use `npx nuxi <command>` or run it via a `package.json` script (e.g., `npm run dev`).","cause":"The `nuxi` executable is not found in your system's PATH. This usually means it's not installed globally, or `npx` cannot locate the local installation.","error":"nuxi: command not found"},{"fix":"Upgrade your Node.js version to 16.10.0 or higher, or 18.0.0 or higher. Tools like NVM (Node Version Manager) can help: `nvm install 18 && nvm use 18`.","cause":"Your current Node.js version is older than the minimum required by Nuxi.","error":"Error: Nuxt CLI requires Node.js version ^16.10.0 || >=18.0.0. You are using Node.js v14.x.x"},{"fix":"Remove any direct `proxy` configurations from your Nuxt CLI settings or `nuxt.config.ts` that relied on the internal proxy. Implement an external proxy solution (e.g., `@nuxtjs/proxy`, a custom server middleware, or a reverse proxy server).","cause":"Your Nuxt project is configured to use the deprecated built-in proxy server, which was removed in Nuxi v3.30.0, leading to failed API requests.","error":"Failed to proxy request from 'http://localhost:3000/api/data' to 'http://localhost:5000/data' because the built-in proxy server was removed."}],"ecosystem":"npm","meta_description":null}