The open source coding agent.
TypeScript
fix(npm): Arborist reify fails on compiled binary — Bun pre-resolves node-gyp path at build time (#21040)
Dax629e866ff06f
diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.tsindex b104dd26774..9c3d9bb5b7e 100755--- a/packages/opencode/script/build.ts+++ b/packages/opencode/script/build.ts@@ -209,6 +209,7 @@ for (const item of targets) {conditions: ["browser"],tsconfig: "./tsconfig.json",plugins: [plugin],+ external: ["node-gyp"],compile: {autoloadBunfig: false,autoloadDotenv: false,diff --git a/packages/opencode/src/npm/index.ts b/packages/opencode/src/npm/index.tsindex 9b913b32788..69bb2ca5284 100644--- a/packages/opencode/src/npm/index.ts+++ b/packages/opencode/src/npm/index.ts@@ -67,6 +67,7 @@ export namespace Npm {binLinks: true,progress: false,savePrefix: "",+ ignoreScripts: true,})const tree = await arborist.loadVirtual().catch(() => {})if (tree) {@@ -106,6 +107,7 @@ export namespace Npm {binLinks: true,progress: false,savePrefix: "",+ ignoreScripts: true,})await arb.reify().catch(() => {})}