Installing Node.js

How to install Node.js for Tauri development on any platform, verify the setup, and enable package managers like pnpm and Yarn through Corepack.

Tauri v2 needs Node.js on your machine because the frontend half of a Tauri app — React, Vue, Svelte, plain HTML — is built with standard JavaScript tooling. The create-tauri-app scaffolding tool, the development server, and the final bundling step all run through Node.js.

This guide covers installing the Long Term Support (LTS) release of Node.js 18 or later (the minimum version Tauri v2 expects) and wiring up pnpm or yarn through Corepack so you are ready to scaffold a project. The installation methods work independently; pick the one that matches your workflow.

Why Node.js Is Required

Tauri keeps the frontend and the Rust backend loosely connected. The frontend lives in a standard web project — it has its own package.json, dependencies, and build scripts. Tauri’s CLI calls into Node.js to install those dependencies and to run the development server or the production build. Without Node.js, the toolchain cannot assemble the UI that Tauri will display in its WebView.

Node.js also ships with npm, the default package manager, and since Node 16.10.0 it includes Corepack — a tool that makes pnpm and yarn available without a separate installation. Tauri’s project generator can use any of the three, so enabling Corepack early saves you an extra step later.

What about the Rust backend?:

Tauri’s Rust core is compiled with cargo, not with Node.js. The two ecosystems live side by side — Node builds the UI, Rust builds the native shell. You only need Node.js for the frontend parts.

Installing Node.js

All approaches below get you a working Node.js. The LTS release is strongly recommended because it receives security patches and ecosystem support for several years. At the time of writing, Node.js 24.x is Active LTS and 22.x is Maintenance LTS; either works with Tauri v2.

nvm (Node Version Manager) lets you install several Node versions side by side and switch between them with a single command. It is the safest bet if you ever need to test your Tauri app against a different Node release or if you work on multiple projects that require different versions.

1

Install nvm

On macOS and Linux, use the official install script. Open a terminal and run:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.6/install.sh | bash

After the script finishes, close and reopen the terminal (or run source ~/.bashrc / source ~/.zshrc) so nvm is available.

On Windows, use nvm-windows. Download the latest installer from its releases page and run it. The installer adds nvm to your PATH automatically.

2

Install the latest LTS release

Once nvm is available, install and activate the LTS version:

nvm install --lts
nvm use --lts

The install command downloads and compiles (if needed) the Node binary. The use command makes that version the default for all future terminal sessions.

nvm simplifies version switching:

If you later need Node 18 for a legacy project, run nvm install 18 --lts and nvm use 18. Your Tauri setup remains untouched.

Verifying the Installation

After any installation method, open a new terminal and run:

node -v
npm -v

You should see output similar to:

v24.19.0
11.6.2

The exact numbers will vary, but the major version of Node must be 18 or higher. If node -v returns a lower version or a “command not found” error, restart your terminal and double-check the installation steps.

Node.js 16 and earlier will not work:

Tauri v2 relies on modern JavaScript APIs that are unavailable before Node 18. Attempting to scaffold a project with an older version results in cryptic runtime errors. Verify your version now to avoid wasting time later.

Enabling pnpm and Yarn Through Corepack

Tauri’s project generator (create-tauri-app) can use npm, pnpm, or yarn as the package manager. The pnpm option is popular because it installs dependencies faster and uses less disk space. Instead of installing pnpm or yarn separately, you can enable them through Corepack — a version manager for package managers that ships with Node.js.

Corepack is included by default in Node.js 16.10.0 and later, but it is not active until you explicitly enable it.

Open a terminal and run:

corepack enable

This command makes pnpm and yarn available as global shims. When you first run pnpm or yarn, Corepack downloads the correct version automatically.

If you want to lock a specific version of pnpm (the one that matches Tauri’s scaffolding template, for example), prepare it explicitly:

corepack prepare pnpm@latest --activate

After activation, verify that pnpm is reachable:

pnpm --version

Corepack is the canonical way to get pnpm:

With Corepack enabled, you never need to run npm install -g pnpm again. This keeps your global environment clean and guarantees every project uses the package manager version it was tested with.

Administrator privileges on some systems:

On Linux or macOS, corepack enable may try to write shims to a protected directory. If you see a permission error, either run the command with sudo or configure Corepack to write to a user-owned location by setting the COREPACK_HOME environment variable.

Next Steps

With Node.js and Rust installed, review the full prerequisites checklist in Installing Rust and Node.js and confirm your toolchain with Installing Rust via rustup before proceeding to project scaffolding.