Skip to content

Select language

Current language: English

Installing Node.js

Edit page

This guide covers installing Node.js on Windows, macOS, and Linux. Desktop and the Microsoft Store edition no longer bundle Node.js; they use the node and npm on your system directly, and OpenSpec and most Agent CLIs depend on it as well.

Version Requirements

Node.js 24 or higher is required, and 24 is also the minimum. In most cases, just install the latest LTS version. npm is installed together with Node.js, so you do not need to install it separately.

Which Installation Methods Need It

  • Microsoft Store / Desktop: Required, and node and npm must be found on the system PATH.
  • Docker Compose: Not needed on the host.

Installing Node.js

  1. Visit the Node.js Official Website
  2. Download the LTS (Long Term Support) version Windows installer (.msi file), and confirm the version is not lower than 24
  3. Double-click to run the installer
  4. Follow the installation wizard prompts to complete installation:
    • Accept the license agreement
    • Choose installation path (default is fine)
    • Keep “Add to PATH” checked
    • Click “Install” to start installation
  5. After installation completes, click “Finish”

Method Two: Using winget

Open PowerShell or Command Prompt and run:

终端窗口
winget install OpenJS.NodeJS.LTS

After installation, reopen the terminal for changes to take effect.

Using Version Management Tools

If you need to switch between multiple Node.js versions, you can use version management tools.

Note for Desktop Users

On macOS and Linux, tools such as nvm and fnm usually set PATH only in shell configuration files (such as .bashrc and .zshrc). Desktop launched from the Dock, the application menu, or a desktop icon does not read those files and may not find node. If you use a version management tool, launch Desktop from a terminal where node already works, or use the system-wide installation methods above instead.

nvm (Node Version Manager)

Linux/macOS

Copy the latest installation command directly from the nvm official repository README; do not use old installation script URLs.

After installation, reload your shell configuration:

终端窗口
source ~/.bashrc
# Or for Zsh users
source ~/.zshrc

Windows

On Windows, we recommend using nvm-windows:

  1. Download the latest nvm-setup.exe from nvm-windows releases
  2. Run the installer
  3. Reopen Command Prompt or PowerShell

fnm (Fast Node Manager)

fnm is a faster and simpler Node.js version management tool built with Rust.

Linux/macOS

终端窗口
# Install using curl
curl -fsSL https://fnm.vercel.app/install | bash
# After installation, reload shell configuration
source ~/.bashrc
# Or for Zsh users
source ~/.zshrc

Windows

Use scoop or winget:

终端窗口
# Use scoop
scoop install fnm
# Or use winget
winget install Schniz.fnm

Acceleration for Mainland China Users

If you are in Mainland China, downloading Node.js and npm packages may be slow. You can use domestic mirrors.

npm Mirror

终端窗口
# Temporarily use the mirror to install
npm install --registry=https://registry.npmmirror.com
# Permanently set the mirror
npm config set registry https://registry.npmmirror.com
# Verify the mirror is set successfully
npm config get registry

Node.js Installer Mirror

Node.js installers also have a mirror download address: https://npmmirror.com/mirrors/node/. After visiting it, choose a version not lower than 24 to download.

Homebrew Mirror

If you use Homebrew in Mainland China, you can configure the USTC mirror for bottles:

终端窗口
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles

Verifying Installation

After installation, verify that Node.js and npm are available in a newly opened terminal:

终端窗口
# Check the Node.js version, v24.0.0 or higher is required
node --version
# Check the npm version
npm --version

Successful output should look like:

$ node --version
v24.3.0
$ npm --version
11.4.2

If node --version shows a version lower than 24, reinstall using the methods above, or use a version management tool to switch to 24 or higher.

Configuring the npm Global Directory

Desktop installs managed packages such as Agent CLIs into your local npm global directory. If the global directory is in a location that requires administrator privileges, you may see an EACCES permission error during installation. It is recommended to move the global directory into your user directory instead of changing the permissions of system directories:

终端窗口
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global

Then add ~/.npm-global/bin (on Windows, the npm global directory itself) to the system PATH, and restart your terminal and Desktop. When you use nvm or fnm, the global directory is already under your user directory, so this step is not needed.

Troubleshooting

Windows Issues

If the node or npm command is not available after installation:

  1. Restart Command Prompt or PowerShell
  2. If still not available, manually add Node.js to PATH:
    • Search for “Environment Variables” and open “Edit system environment variables”
    • Click “Environment Variables”
    • Find “Path” in “System variables” and click “Edit”
    • Add Node.js installation path (default: C:\Program Files\nodejs\)
    • Click “OK” to save changes
  3. Fully quit and restart Desktop

macOS Issues

If you encounter permission errors when installing global npm packages, see Configuring the npm Global Directory above, or use nvm / fnm instead.

Linux Issues

If you encounter permission errors when installing global npm packages, see Configuring the npm Global Directory above, or use nvm / fnm instead of installing global packages with sudo.

Checking Environment

If verification fails, check the following:

终端窗口
# Check if Node.js is in PATH
where node
# Check installation path
Get-Command node

Next Steps

After Node.js installation is complete, you can continue with the following steps:

Need More Help?

If you encounter issues not covered here:

  1. Visit the Node.js Official Documentation
  2. See How Desktop Uses Your Node Environment
  3. Review the HagiCode Product Overview for current product and tooling context

HagiCode

HagiCode is an agentic coding workspace. OpenSpec workflows plan the change, multi-agent execution carries it out, and Hero Dungeon makes the long run visible, so ideas become shipped software.

Turn ideas into polished, usable software with a smarter, faster, and more enjoyable agentic coding workflow.

Visit HagiCodeRead the documentation
  • SmartOpenSpec workflows turn intent into an executable path, from proposal to design, tasks, and a shipped change.
  • EfficientMulti-agent execution keeps research, implementation, and review moving in parallel, across several repositories and the Agent CLIs you already use.
  • FunHero Dungeon turns long coding sessions into a visible, collaborative adventure with heroes, progress, and achievements.

HagiCode at a glance

  • HagiCode workbench showing a session kanban board with Pending, In Progress, and Archived columns.
    The workbench: every session on one kanban board.
  • HagiCode proposal stage bar from Created to Archived, with the Execution Completed stage highlighted and an Archive Plan button.
    A proposal moves from created to drafted, reviewed, executed, and archived.
  • HagiCode Hero Dungeon panel named Ember Keep, listing three running heroes with their level, progress, and story text.
    Hero Dungeon: heroes run the work while you follow progress, levels, and story.

Download for Windows

Get it from Microsoft StoreAll downloads