Installing OpenClaw on Windows using PowerShell can sometimes fail with confusing error messages. Many users attempting to run the OpenClaw installer encounter issues such as “npm error spawn git ENOENT”, installation scripts failing, or commands not executing properly. This problem is quite common, especially for users setting up OpenClaw for the first time.

The main reason this happens is that OpenClaw relies on several system dependencies such as Git, Node.js, and Microsoft C++ Build Tools. If any of these components are missing, outdated, or incorrectly configured, the installation process can fail. Many users also experience issues related to PowerShell permissions, antivirus blocking scripts, or incorrect installation paths.

This updated guide includes additional fixes discovered by developers and users, including solutions shared in online forums and community discussions. If the basic installation method does not work, these extra steps can help resolve the OpenClaw installation error.

Common Errors When Installing OpenClaw

Users trying to install OpenClaw on Windows may encounter several types of errors, including:

  • npm error spawn git ENOENT

  • Installation script failing in PowerShell

  • Node executable path errors

  • Dependency installation failures

  • Permission or script execution errors

These problems typically occur because the system is missing required tools or because PowerShell cannot access them properly.

Step 1: Run PowerShell as Administrator

Before installing anything, always open PowerShell with administrator privileges.

Follow these steps:

  1. Click the Windows Search bar.

  2. Type PowerShell.

  3. Right-click Windows PowerShell.

  4. Select Run as Administrator.

Running PowerShell as administrator ensures the installation commands have the necessary system permissions.

Step 2: Install Git for Windows

One of the most common causes of the OpenClaw installation error is Git not being installed.

To install Git quickly using the Windows package manager, run this command in PowerShell:

winget install git.git

After the installation completes, close PowerShell completely and reopen it as administrator. This refreshes the system environment so PowerShell can recognize Git.

Many users report that simply installing Git and restarting PowerShell immediately fixes the installation error.

Step 3: Run the OpenClaw Installer

Once Git is installed, you can run the official OpenClaw installation command:

iwr -useb https://openclaw.ai/install.ps1 | iex

This command downloads the OpenClaw installation script and executes it automatically inside PowerShell.

If everything is set up correctly, the installer should begin downloading the required files and completing the installation.

Step 4: Install Microsoft C++ Build Tools (If Installation Fails)

If the installation still fails, another common missing dependency is Microsoft C++ Build Tools.

OpenClaw sometimes requires these tools when compiling certain components.

To install them:

  1. Visit the Microsoft C++ Build Tools installer page.

  2. Download the installer.

  3. During setup, select only the following components:

  • Desktop development with C++

  • MSVC v143

  • Windows 10/11 SDK

You do not need to install the full Visual Studio IDE, only the build tools.

After installation, try running the OpenClaw installer again.

Step 5: Check Your Node.js Version

Newer Node versions can cause OpenClaw installation to fail.

A reliable fix is to use Node.js version 22. In some cases, installing a slightly older Node version also solves the problem.

After installing or downgrading Node.js, restart PowerShell and run the OpenClaw installation command again.

Step 6: Adjust PowerShell Script Execution Policy

If PowerShell blocks the installation script, you may need to allow script execution.

Run this command in PowerShell:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

This allows trusted scripts to run on your system while maintaining basic security protections.

Step 7: Clear Temporary Installation Files

Sometimes installation errors occur because leftover temporary files interfere with the setup.

You can clear them using this command:

Remove-Item “$env:TEMP\OpenClaw*” -ErrorAction SilentlyContinue

After clearing the temporary files, try running the installer again.

Step 8: Disable Antivirus Temporarily

In some cases, Windows Defender or antivirus software blocks OpenClaw installation scripts.

This happens because the script downloads and runs external files, which security tools may flag as suspicious.

Temporarily disabling Windows Defender during installation can allow the installer to run successfully. Once installation is complete, antivirus protection can be re-enabled.

Step 9: Avoid Running Installation from the System32 Folder

Some users reported that running the installer from the System32 directory causes errors.

A safer approach is to create a new folder for OpenClaw installation.

For example:

  1. Create a folder named OpenClaw anywhere on your computer.

  2. Open PowerShell from that folder.

  3. Run the installation command again.

This prevents permission conflicts that sometimes occur in protected system directories.

Step 10: Alternative Methods if PowerShell Fails

If PowerShell still fails to install OpenClaw, you can try:

  • Running the installer in PowerShell 7

  • Using the Command Prompt instead of PowerShell

While these solutions do not work for everyone, they have helped some users complete the installation.

The OpenClaw install error in PowerShell is usually caused by missing dependencies such as Git, incorrect Node.js versions, or blocked scripts. Fortunately, the problem can almost always be fixed by installing the required tools and adjusting the system configuration.

The most effective fixes include:

  • Installing Git for Windows

  • Using Node.js version 22

  • Installing Microsoft C++ Build Tools

  • Running PowerShell as Administrator

  • Allowing scripts through Execution Policy

  • Clearing temporary installation files

By following these steps, most users are able to install OpenClaw successfully and avoid the frustrating errors that occur during the initial setup.

Write a comment