openclaw - 💡(How to fix) Fix Declare node-gyp for local native package builds [1 pull requests]

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…

Root Cause

OpenClaw does not directly invoke node-gyp, but native package postinstall scripts can. In this environment, sharp detected a source-build path and expected node-gyp to be available from the workspace dependency graph. Without declaring it, normal repo bootstrap commands can fail before any OpenClaw code runs.

Declaring node-gyp as a root dev dependency makes that native-build fallback reproducible and avoids relying on a globally installed node-gyp.

Fix Action

Fixed

Code Example

node_modules/sharp install: sharp: Attempting to build from source via node-gyp
node_modules/sharp install: sharp: Found node-addon-api 8.7.0
node_modules/sharp install: sharp: Please add node-gyp to your dependencies
node_modules/sharp install: Failed
[ELIFECYCLE] Command failed with exit code 1.
RAW_BUFFERClick to expand / collapse

Problem

A fresh local install can fail when sharp falls back to building from source and cannot find a project-local node-gyp binary.

Observed while running pnpm docs:list from a checkout without installed dependencies. The docs command triggered dependency hydration, then sharp ran its install script and failed with:

node_modules/sharp install: sharp: Attempting to build from source via node-gyp
node_modules/sharp install: sharp: Found node-addon-api 8.7.0
node_modules/sharp install: sharp: Please add node-gyp to your dependencies
node_modules/sharp install: Failed
[ELIFECYCLE] Command failed with exit code 1.

Why this matters

OpenClaw does not directly invoke node-gyp, but native package postinstall scripts can. In this environment, sharp detected a source-build path and expected node-gyp to be available from the workspace dependency graph. Without declaring it, normal repo bootstrap commands can fail before any OpenClaw code runs.

Declaring node-gyp as a root dev dependency makes that native-build fallback reproducible and avoids relying on a globally installed node-gyp.

Proposed fix

Add node-gyp to the root devDependencies and update pnpm-lock.yaml.

Verification

With node-gyp declared locally:

  • pnpm install completes
  • pnpm docs:list completes
  • pnpm exec node-gyp --version prints v12.3.0

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Declare node-gyp for local native package builds [1 pull requests]