Skip to content

Commit 8250ab7

Browse files
committed
debug(sea-builder): add diagnostic output for postject resolution
Add detailed error logging to diagnose why postject is not being found on Windows CI runners despite being in devDependencies. This will help identify whether it's a PATH issue, installation issue, or pnpm exec resolution problem. Logs include: - Error message from spawn - Platform and CWD - Existence checks for postject in various node_modules paths
1 parent 9311eb6 commit 8250ab7

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

packages/node-sea-builder/scripts/build.mjs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,26 @@ async function injectSeaBlob(nodeBinary, blobPath, outputPath, fuseSentinel) {
346346
await spawn('pnpm', ['exec', 'postject', '--help'], {
347347
stdio: 'ignore',
348348
})
349-
} catch {
349+
} catch (e) {
350+
logger.error('Failed to execute postject check')
351+
logger.error(`Error: ${e.message}`)
352+
logger.error(`Platform: ${process.platform}`)
353+
logger.error(`CWD: ${process.cwd()}`)
354+
355+
// Log node_modules structure for debugging.
356+
try {
357+
const { existsSync } = await import('node:fs')
358+
const postjectPaths = [
359+
'node_modules/.bin/postject',
360+
'../../node_modules/.bin/postject',
361+
'node_modules/postject',
362+
'../../node_modules/postject',
363+
]
364+
for (const p of postjectPaths) {
365+
logger.error(` ${p}: ${existsSync(p) ? 'exists' : 'not found'}`)
366+
}
367+
} catch {}
368+
350369
throw new Error(
351370
'postject is required to inject the SEA blob into the Node.js binary.\n' +
352371
'Please install it: pnpm add -D postject',

0 commit comments

Comments
 (0)