Registry / devops / nuxi
library3.34.0jsnpmunverified

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.

npm install nuxi
INSTALL
IMPORT
SIG · NUXI
N
nuxi
devopsjavascriptv3.34.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

nuxi (CLI via npx)
npx nuxi <command>
npm install -g nuxi && nuxi <command>
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.
nuxi (package.json script)
"scripts": { "dev": "nuxi dev", "build": "nuxi build", "preview": "nuxi preview" }
"scripts": { "dev": "nuxt dev" }
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.
runMain (programmatic)
import { runMain } from 'nuxi/dist/shared/nuxi'; async function executeNuxiCommand() { // Example: Programmatically run 'nuxi build ./path/to/my-project' await runMain(['build', './path/to/my-project']); console.log('Nuxt build completed programmatically.'); } executeNuxiCommand();
import nuxi from 'nuxi'; // No default export for a direct programmatic API
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.

Initializes a new Nuxt 3 project with interactive prompts, installs dependencies, and starts the development server, demonstrating the core Nuxi workflow.

# Initialize a new Nuxt 3 project in a directory named 'my-nuxt-project'. # This command will interactively guide you through setting up project preferences # such as package manager, TypeScript support, and common Nuxt modules. npx nuxi init my-nuxt-project # Navigate into your newly created project directory to continue setup. cd my-nuxt-project # Install the necessary project dependencies using your chosen package manager (e.g., npm, yarn, pnpm). # This step fetches all required packages, including Nuxt itself and any modules you selected during initialization. npm install # Start the Nuxt development server. This command compiles your application # and provides hot module reloading, making it easy to see changes instantly. # Your application will typically be accessible in your web browser at http://localhost:3000. npm run dev # After development, you can build your application for production using: # npm run build
nuxi --version
Debug
Known issues
breakingNuxi 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.
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.
affects: >=3.30.0
deprecatedThe `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.
fix
Replace `nuxi module add <module-name>` with `nuxi add <module-name>` in all scripts and documentation.
affects: >=3.32.0
breakingNuxi 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.
fix
Upgrade your Node.js environment to a compatible version using a Node Version Manager (e.g., `nvm install 18` and `nvm use 18`).
affects: >=3.0.0
gotchaIn 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.
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.
affects: >=3.0.0 <3.31.3
gotchaEarly 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.
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.
affects: <3.32.0
Errors
Common errors & fixes
nuxi: command not found
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.
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`).
Error: Nuxt CLI requires Node.js version ^16.10.0 || >=18.0.0. You are using Node.js v14.x.x
Your current Node.js version is older than the minimum required by Nuxi.
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`.
Failed to proxy request from 'http://localhost:3000/api/data' to 'http://localhost:5000/data' because the built-in proxy server was removed.
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.
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).
Upgrade
Version history
3.34.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
nuxi — npm install nuxi · libregistry