openclaw - ✅(Solved) Fix Bug: OpenClaw 2026.3.13 npm package missing dist/gateway.js - Gateway fails to start, ERR_CONNECTION_REFUSED [2 pull requests, 7 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#49338Fetched 2026-04-08 00:56:21
View on GitHub
Comments
7
Participants
4
Timeline
34
Reactions
0
Timeline (top)
mentioned ×10subscribed ×10commented ×7cross-referenced ×4

Hi OpenClaw team, I'm on Windows 10/11, Node v20.20.1 (also tried v22.9.0), npm install -g openclaw@latest succeeds, but dist/gateway.js is missing in the installed package. Steps to reproduce:

npm uninstall -g openclaw npm cache clean --force npm install -g openclaw@latest dir "%APPDATA%\npm\node_modules\openclaw\dist\gateway.js" → Path not found openclaw gateway start → Service starts but no node process, port 18789 not listening Browser: http://127.0.0.1:18789/ → ERR_CONNECTION_REFUSED Direct run: node .../dist/gateway.js --port 18789 → Error: Cannot find module '.../dist/gateway.js'

Tried:

Multiple reinstalls Taobao mirror Deleted ~/.openclaw Task Scheduler task enabled + highest privileges Firewall allows node.exe Disabled antivirus/360

Log snippet: Error: Cannot find module '...\dist\gateway.js' at Module._resolveFilenameName ... Is this a known packaging issue in 2026.3.13? Is there a workaround or fixed version? Thanks for any help!

Error Message

Direct run: node .../dist/gateway.js --port 18789 → Error: Cannot find module '.../dist/gateway.js' Error: Cannot find module '...\dist\gateway.js'

Root Cause

Hi OpenClaw team, I'm on Windows 10/11, Node v20.20.1 (also tried v22.9.0), npm install -g openclaw@latest succeeds, but dist/gateway.js is missing in the installed package. Steps to reproduce:

npm uninstall -g openclaw npm cache clean --force npm install -g openclaw@latest dir "%APPDATA%\npm\node_modules\openclaw\dist\gateway.js" → Path not found openclaw gateway start → Service starts but no node process, port 18789 not listening Browser: http://127.0.0.1:18789/ → ERR_CONNECTION_REFUSED Direct run: node .../dist/gateway.js --port 18789 → Error: Cannot find module '.../dist/gateway.js'

Tried:

Multiple reinstalls Taobao mirror Deleted ~/.openclaw Task Scheduler task enabled + highest privileges Firewall allows node.exe Disabled antivirus/360

Log snippet: Error: Cannot find module '...\dist\gateway.js' at Module._resolveFilenameName ... Is this a known packaging issue in 2026.3.13? Is there a workaround or fixed version? Thanks for any help!

Fix Action

Fix / Workaround

Log snippet: Error: Cannot find module '...\dist\gateway.js' at Module._resolveFilenameName ... Is this a known packaging issue in 2026.3.13? Is there a workaround or fixed version? Thanks for any help!

PR fix notes

PR #49360: fix: test commit for issue 49338

Description (problem / solution / changelog)

Fixes #49338

Automatically generated by xi7ang-bot.

Changed files

  • test_fix.md (added, +1/-0)

PR #49473: fix: Fix for issue #49338

Description (problem / solution / changelog)

Fixes #49338

Automatically generated by xi7ang-bot.

Changed files

  • fix_49338.md (added, +3/-0)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

Hi OpenClaw team, I'm on Windows 10/11, Node v20.20.1 (also tried v22.9.0), npm install -g openclaw@latest succeeds, but dist/gateway.js is missing in the installed package. Steps to reproduce:

npm uninstall -g openclaw npm cache clean --force npm install -g openclaw@latest dir "%APPDATA%\npm\node_modules\openclaw\dist\gateway.js" → Path not found openclaw gateway start → Service starts but no node process, port 18789 not listening Browser: http://127.0.0.1:18789/ → ERR_CONNECTION_REFUSED Direct run: node .../dist/gateway.js --port 18789 → Error: Cannot find module '.../dist/gateway.js'

Tried:

Multiple reinstalls Taobao mirror Deleted ~/.openclaw Task Scheduler task enabled + highest privileges Firewall allows node.exe Disabled antivirus/360

Log snippet: Error: Cannot find module '...\dist\gateway.js' at Module._resolveFilenameName ... Is this a known packaging issue in 2026.3.13? Is there a workaround or fixed version? Thanks for any help!

Steps to reproduce

npm package incomplete, missing dist/gateway.js, node v20/v22, Windows, ERR_CONNECTION_REFUSED

Expected behavior

npm package incomplete, missing dist/gateway.js, node v20/v22, Windows, ERR_CONNECTION_REFUSED

Actual behavior

npm package incomplete, missing dist/gateway.js, node v20/v22, Windows, ERR_CONNECTION_REFUSED

OpenClaw version

2026.3.13

Operating system

Windows 10/11

Install method

npm global

Model

groks-3

Provider / routing chain

grok

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

The fix involves ensuring the dist/gateway.js file is properly included in the npm package.

  • Check the package.json file for a build or prepare script that generates the dist/gateway.js file.
  • Run the command npm run build or npm run prepare to generate the missing file.
  • If the file is still missing, check the .npmignore file for any patterns that might be excluding the dist/gateway.js file.
  • Update the .npmignore file to exclude any unnecessary files, but ensure the dist/gateway.js file is included.

Example package.json script:

"scripts": {
  "build": "node ./build.js"
}

Example build.js file:

const { exec } = require('child_process');

exec('tsc', (error) => {
  if (error) {
    console.error('Error building project:', error);
    return;
  }
  console.log('Project built successfully.');
});

Verification

To verify the fix, run the following commands:

  • npm run build to generate the dist/gateway.js file.
  • npm install -g openclaw@latest to reinstall the package.
  • dir "%APPDATA%\npm\node_modules\openclaw\dist\gateway.js" to check if the file exists.
  • openclaw gateway start to start the service and verify it's listening on port 18789.
  • http://127.0.0.1:18789/ in a browser to verify the service is accessible.

Extra Tips

  • Ensure the tsc compiler is installed and configured correctly.
  • Check the tsconfig.json file for any settings that might be affecting the build process.
  • If issues persist, try cleaning the npm cache and reinstalling the package.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

npm package incomplete, missing dist/gateway.js, node v20/v22, Windows, ERR_CONNECTION_REFUSED

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING