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
- Open the Node.js official website.
- Download the LTS version Windows installation package.
- Install with default options.
- After the installation is complete, close and reopen PowerShell or Windows Terminal.
- 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
nodeis not an internal or external command: restart the terminal or computer, if it still fails, check whether Node.js is added to PATH.npxExecution 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.