Skip to main content

Windows platform

Some AI programming tools and one-click installation scripts require Node.js environment. Windows users are recommended to use the one-click script on this site to install Node.js v22 LTS.

Recommendation: One-click installation​

Execute in PowerShell:

irm https://docs.muskapi.cc/scripts/install-node.ps1 | iex

The script will only install or upgrade the Node.js environment and configure the npm registry. It will not configure Claude, Codex or any API Key.

If your installation is slow in a domestic network environment, the script will prompt whether to use a domestic image by default. It can also be specified explicitly:

$env:INSTALL_MIRROR="cn"; irm https://docs.muskapi.cc/scripts/install-node.ps1 | iex

After the installation is complete, close and reopen PowerShell and check the version again:

node -v
npm -v
npx -v

node -v displays version 22 or higher.

Alternate: Official installation package​

  1. Open the Node.js official website.
  2. Download the LTS version Windows installation package.
  3. Install with default options.
  4. After the installation is complete, close and reopen PowerShell or Windows Terminal.
  5. Perform a version check.
node -v
npm -v
npx -v

As long as node -v shows version 22 or higher, you can continue installing the client tools.

Alternate: winget installation​

If your Windows has winget installed, you can execute it in PowerShell:

winget install OpenJS.NodeJS.LTS

After the installation is complete, reopen the terminal and check the version again:

node -v
npm -v

FAQ​

  • node is not an internal or external command: restart the terminal or computer, if it still fails, check whether Node.js is added to PATH.
  • npx Execution is slow: Check network proxy, DNS or npm registry.
  • Versions lower than 22: Install LTS after uninstalling the old version, or re-execute the one-click script.
  • PowerShell disables script execution: Open PowerShell as an administrator, or check the system execution policy.