#npm error code enonet

1 messages · Page 1 of 1 (latest)

gaunt berry
#

node.exe : npm error code ENOENT
At line:1 char:1

  • & "C:\Program Files\nodejs/node.exe" "C:\Program Files\nodejs/node_mo ...
  •   + CategoryInfo          : NotSpecified: (npm error code ENOENT:String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
bold radishBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

gaunt berry
#

Have looked into uninstalling and reinstalling node to no avail

tired vergeBOT
#

ENOENT in npm basically means “a file/folder npm expected doesn’t exist”. The snippet you pasted is only the first line of npm’s error; the useful part is usually the next lines like:

  • npm ERR! path ...
  • npm ERR! syscall open
  • npm ERR! enoent ... package.json (or some other file)

Can you paste the full npm output (everything from npm ERR! code ENOENT down), plus:

  1. the exact command you ran (npm install / npm ci / etc.)
  2. what folder you ran it in (pwd / the path)

In the meantime, the most common fixes on Windows are:

1) You’re in the wrong directory (no package.json)

If the error mentions package.json, then you likely ran npm in a folder that isn’t a node project.

  • cd into the project folder (the one that actually has package.json)
  • then run npm install
#

2) Your Node/npm install is broken (npm files missing)

If the error mentions something like:
C:\Program Files\nodejs\node_modules\npm\... being missing, your Node install is incomplete/corrupted.

Quick checks:

node -v
npm -v
where node
where npm

If npm -v fails or it can’t find files under C:\Program Files\nodejs\node_modules\npm\..., the practical fix is:

  • uninstall Node
  • reinstall Node LTS from https://nodejs.org (I’d avoid the Microsoft Store install for this kind of issue)
  • open a fresh terminal and try again
#

3) npm is trying to access a missing file from a script

If it happens during npm run <script>, the missing path will be shown in the npm ERR! path ... line — paste that and I’ll tell you exactly what’s missing and why.

Paste the full error block and we can narrow it down in one go.

#

If reinstalling Node didn’t change it, this is usually one of these on Windows:

  1. PATH conflict / multiple Node installs (Store/Chocolatey/Scoop/nvm-windows leftovers)
  2. stale npm “shim” scripts in %AppData%\npm\ that still point to an old/nonexistent Node path
  3. npm is trying to open a missing file (we need the npm ERR! path ... line to know which)

Can you run these in PowerShell and paste the output?

node -v
npm -v
where node
where npm
Get-Command node | Format-List Source,Version
Get-Command npm  | Format-List Source,Version
Test-Path "C:\Program Files\nodejs\node.exe"
#
Test-Path "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js"

Very common fix: stale %AppData%\npm shims

If where npm shows something like:
C:\Users\<you>\AppData\Roaming\npm\npm.ps1 (or npm.cmd) before C:\Program Files\nodejs\npm.cmd, that shim may be broken.

Try:

dir "$env:APPDATA\npm"

If you see npm.ps1, npm.cmd, npx.ps1, npx.cmd, rename the folder (safe + reversible):

ren "$env:APPDATA\npm" "npm.bak"
#

Then open a new PowerShell window and try npm -v again.

If npm-cli.js is missing

If Test-Path "...\npm-cli.js" is False, the install is still not right. In that case, tell me how you installed Node (Node MSI from nodejs.org vs Microsoft Store vs nvm-windows vs Chocolatey/Scoop) and what where node returns (often it’s not using the Node you think).

Paste those outputs and I can tell you exactly which of the above you’re hitting.

gaunt berry
#

where node and where npn do not give any response

#

node -v
v24.13.1
npm -v
11.8.0

tired vergeBOT
#

That’s actually a PowerShell gotcha: in PowerShell, where is an alias for Where-Object, so where node prints nothing unless you pipe input into it.

Use where.exe (the real Windows locator), or Get-Command:

Run these and paste the output:

# What shell are we in?
$PSVersionTable.PSVersion

# Use the real Windows where
where.exe node
where.exe npm

# PowerShell-native command discovery
Get-Command node -All | Format-List Name,Source,Version
#
Get-Command npm  -All | Format-List Name,Source,Version

# Check if Node exists at the usual install path
Test-Path "$env:ProgramFiles\nodejs\node.exe"
Test-Path "$env:ProgramFiles\nodejs\npm.cmd"

What I’m looking for:

  • If Test-Path ...node.exe is True but where.exe node finds nothing → Node is installed but not on PATH (installer option didn’t stick, or PATH got overwritten). Fix is adding C:\Program Files\nodejs\ to PATH + opening a new terminal.
  • If where.exe node shows multiple entries → you’ve got multiple Node installs fighting (Store + MSI + nvm/scoop/choco), and npm may be calling the wrong one.

Also: confirm whether you installed Node via nodejs.org MSI or Microsoft Store / nvm-windows / Chocolatey / Scoop. That changes the cleanup steps.

#

Cool — if node -v and npm -v both work, then Node/npm themselves are basically fine. ENOENT is now almost certainly “npm can’t find some file/path it expects” (most commonly package.json, a lockfile, or a configured cache/prefix dir).

Can you paste the output of these exact commands (in a triple-backtick code block), and also tell me the exact npm command that fails?

Get-Location
dir

where.exe node
where.exe npm

npm config get prefix
npm config get cache

Then re-run the failing command with verbose logging and paste from npm ERR! code ENOENT down:

#
npm <your command here> --verbose

Two quick “usual suspects” to check right now:

1) Wrong folder (no package.json)

If dir doesn’t show package.json, npm install will often end in an ENOENT about package.json.
Fix: cd into the folder that contains package.json (or run npm init -y if you’re starting fresh).

2) Broken cache/prefix path

If npm config get cache or prefix points to a folder that doesn’t exist, npm can throw ENOENT.
Fix is usually just creating the folder (once we see the exact path).

Post those outputs and the exact command you ran, and I’ll tell you the precise fix.

gaunt berry
#

PS C:\Users\holob> Get-Command node | Format-List Source,Version

Source : C:\Program Files\nodejs\node.exe
Version : 24.13.1.0

PS C:\Users\holob> Get-Command npm | Format-List Source,Version

Source : C:\Program Files\nodejs\npm.ps1
Version :

PS C:\Users\holob> Test-Path "C:\Program Files\nodejs\node.exe"
True

#

PS C:\Users\holob> # Check if Node exists at the usual install path
PS C:\Users\holob> Test-Path "$env:ProgramFiles\nodejs\node.exe"
True
PS C:\Users\holob> Test-Path "$env:ProgramFiles\nodejs\npm.cmd"
True
PS C:\Users\holob>

#

The npm command which fails is the install command for openclaw

tired vergeBOT
#

That output is getting mangled by Discord: every \n in the path is being rendered as a newline, so C:\Program Files\nodejs\node.exe turns into:

C:\Program Files + newline + odejs + newline + ode.exe

Please paste outputs inside a code block so we can see the real paths:

(like this)

Also: since node -v and npm -v work, Node/npm are installed fine — ENOENT is now about some specific missing file (package.json, a script command, cache dir, etc.). We need the line that says what path/command is missing.

Run these and paste all output in a single code block:

Get-Location
#
dir

where.exe node
where.exe npm
Get-Command npm -All | Format-List Source

npm config get prefix
npm config get cache

# then re-run the exact failing command with verbose:
npm <the command that fails> --verbose

Key thing to include from the error: the lines starting with npm ERR! syscall ... and npm ERR! path ... (or npm ERR! spawn ...). That will tell us exactly what is ENOENT.

gaunt berry
#

Ok will do now

tired vergeBOT
#

You pasted the commands, not the output, so I still can’t see what’s missing.

Also: your earlier where node issue is because in PowerShell where is not the Windows “where”; it’s an alias. Use where.exe.

Please run these and paste the output inside a code block:

npm -v
node -v
where.exe node
where.exe npm
Get-Location
dir

Then run the exact command that fails again and paste the error from npm ERR! code ENOENT downwards (those lines include the crucial npm ERR! path ...).

#

One quick check you can do right now (this is the #1 ENOENT cause):

  • In the folder where you run npm, do you have package.json?
    • If you’re currently in C:\Users\holob and there’s no package.json there, npm install will ENOENT.
    • Fix: cd into the project folder (the one containing package.json) and run again.

If you can paste the npm ERR! path ... line, I can tell you the precise fix immediately.

#

Given node -v and npm -v work, this is no longer “Node isn’t installed” — npm ERR! code ENOENT means npm is trying to read/run some specific path that doesn’t exist.

For npm install the #1 cause is simply: you’re not in a project folder (no package.json).

Run this in the same terminal where npm install fails and paste the output (please wrap in a code block so the \nodejs\... paths don’t get split into new lines):

Get-Location
Test-Path .\package.json
dir .\package.json
  • If Test-Path .\package.json is False: npm install will throw ENOENT. Fix = cd into the folder that contains your project’s package.json (or run npm init -y if you’re starting a new project).
  • If it’s True: then ENOENT is about some other missing file/tool. In that case, re-run and paste the error block:
#
npm install --verbose

Specifically, I need the lines that start with npm ERR! path and/or npm ERR! syscall (or npm ERR! spawn ... ENOENT) — that line tells us exactly what is missing (common examples: ...package.json, or spawn git ENOENT if Git isn’t installed).

#

Yep — run it and paste the output.

To avoid the \nodejs\ turning into weird line breaks, please paste everything inside a real code block (three backticks on their own lines), like:

...your output here...

Run these in the same PowerShell window where npm install fails:

Get-Location
Test-Path .\package.json
dir

npm install --verbose
#
  • If Test-Path .\package.json is False, that’s the cause: you’re not in a Node project folder. cd into the folder that actually contains package.json and run npm install there.
  • If it’s True, the --verbose output will include the key lines (npm ERR! path ... / npm ERR! syscall ... / npm ERR! spawn ... ENOENT) that tell us exactly what file/tool is missing.
gaunt berry
#

Running npm -v onwards:

11.8.0
PS C:\Users\holob> node -v
v24.13.1
PS C:\Users\holob> where.exe node
C:\Program Files\nodejs\node.exe
PS C:\Users\holob> where.exe npm
C:\Program Files\nodejs\npm
C:\Program Files\nodejs\npm.cmd
PS C:\Users\holob> Get-Location

Path
----
C:\Users\holob


PS C:\Users\holob> dir


    Directory: C:\Users\holob


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         23/8/2025  11:56 pm                .android
d-----          5/8/2025  11:38 pm                .gradle
d-----         11/9/2025  11:13 am                .ms-ad
d-----         16/2/2026   9:14 pm                .MUMUVMM
d-----          5/8/2025  11:39 pm                .skiko
d-----          5/8/2025  11:37 pm                AndroidStudioProjects
d-----         13/6/2025  11:21 pm                ansel
d-----         14/9/2025  11:13 pm                Apple
d-r---         13/6/2025  10:11 pm                Contacts
d-r---         16/2/2026   9:47 am                Desktop
d-r---          3/1/2026  11:45 pm                Documents
d-r---         16/2/2026  11:27 pm                Downloads
d-r---         13/6/2025  10:11 pm                Favorites
d-r---         13/6/2025  10:11 pm                Links
d-r---         14/9/2025  11:10 pm                Music
dar--l         13/6/2025  10:37 pm                OneDrive
d-r---         2/11/2025   9:42 pm                Pictures
d-r---         13/6/2025  10:11 pm                Saved Games
d-r---          8/7/2025  10:46 pm                Searches
d-r---         13/6/2025  11:21 pm                Videos
-a----          5/8/2025  11:44 pm             16 .emulator_console_auth_token
-a----        29/10/2025  10:29 am            895 mumu_boot.txt```
#

Text below npm ERR! code ENOENT

+ & "C:\Program Files\nodejs/node.exe" "C:\Program Files\nodejs/node_mo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (npm error code ENOENT:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError```
#

The command ran was:
iwr -useb https://openclaw.ai/install.ps1 | iex

tired vergeBOT
#

You’re running npm install in C:\Users\holob and that folder clearly has no package.json in it.

If your command was exactly npm install (with no package name), npm will try to open .\package.json and will fail with ENOENT because it doesn’t exist.

Fix

Option A (most common): go to your actual project folder (the one that contains package.json) and run install there:

cd "C:\path\to\your\project"
dir package.json
npm install

Option B (new project): create a project first:

mkdir my-app
cd my-app
#
npm init -y
npm install

Option C (you meant to install a tool globally):

npm install -g <package-name>

If you paste the exact command you ran (e.g. npm install vs npm install openclaw vs npm i -g ...) and the npm ERR! path ... line, I can confirm 100%—but from what you showed, “wrong directory / no package.json” is the issue.

#

That At line:1 char:1 ... NativeCommandError block is just PowerShell telling you “a native command failed” — it’s not the real npm error. The installer script runs:

npm install -g openclaw@latest

…but it forces NPM_CONFIG_LOGLEVEL=error, so you’re not seeing the useful lines like npm ERR! path ... / npm ERR! syscall ... / npm ERR! spawn ... ENOENT.

Do this to get the actual missing thing:

  1. Run the install command directly with verbose output:
npm.cmd install -g openclaw@latest --loglevel verbose
  1. If it still ends with ENOENT, paste the lines starting at:
  • npm ERR! code ENOENT
  • especially any npm ERR! path ... or npm ERR! spawn ... ENOENT
#
  1. Also check whether it’s failing because something like git/python is missing:
git --version
py --version
python --version

One likely culprit: you’re on Node v24 (v24.13.1). If the verbose log mentions node-gyp / python / build tools, that often happens because some dependencies don’t have prebuilt binaries for Node 24 yet. In that case, switching to Node 22 LTS usually fixes it.

Paste the verbose error block and I’ll tell you exactly what’s missing and the fastest fix.

gaunt berry
#
npm error syscall spawn git
npm error path git
npm error errno -4058
npm error enoent An unknown git error occurred
npm error enoent This is related to npm not being able to find a file.
npm error enoent```
Have switched to Node 22 LTS prior to running the install command with verbose output
tired vergeBOT
#

That’s the smoking gun:

npm error syscall spawn git
npm error path git
npm error errno -4058

It means npm tried to run git (because one of the dependencies is coming from a git URL), but Git isn’t installed or isn’t on PATH.

Fix: install Git (and make sure it’s on PATH)

Option 1 (easy, Windows 11):

winget install --id Git.Git -e
#

Option 2 (installer):
Download “Git for Windows” from https://git-scm.com/download/win
During install, pick the option like “Git from the command line and also from 3rd-party software” (that’s the PATH option).

Then close and reopen PowerShell, and verify:

git --version
where.exe git

After that, retry:

npm install -g openclaw@latest
# or
#
iwr -useb https://openclaw.ai/install.ps1 | iex

If Git is installed but npm still can’t find it

Your PATH is missing Git. The usual folder to add is:

  • C:\Program Files\Git\cmd

(Quick test in the current shell, not permanent:)

$env:Path += ";C:\Program Files\Git\cmd"
git --version

If you paste the output of git --version + where.exe git after installing, I can confirm it’s correctly wired.

gaunt berry
#

Thanks for helping me troubleshoot the issue

#

No need to check git

#

git was properly installed and so was openclaw

tired vergeBOT
#

No problem — that error was a sneaky one, but the spawn git ENOENT line makes it clear.

If it works after installing Git: please right-click the message with the fix → Apps → ✅ Mark Solution so Answer Overflow indexes it for the next person.

If you hit anything else during the install, paste the new npm ERR! block and we’ll keep going.

#

Nice — glad it’s unblocked.

If you have a minute: please right-click the solution message → Apps → ✅ Mark Solution so it gets indexed on Answer Overflow (it’ll save others a bunch of time).

Next steps are usually:

  • openclaw --version
  • then openclaw doctor (optional but helpful)
  • and openclaw gateway install && openclaw gateway start when you’re ready to run it