stablyai/orca · critical

Packaged node-pty has no ConPTY payload for win10-${windowsA

Error message

Packaged node-pty has no ConPTY payload for win10-${windowsArch}

What it means

Thrown by findNodePtyConptySourceDir when node-pty/third_party/conpty exists but none of its subdirectories contains a win10-<windowsArch> folder matching the build's target architecture (x64 or arm64). The packager walks each vendor subdirectory looking for win10-x64 or win10-arm64 and falls through to this error if none matches.

Source

Thrown at config/packaged-runtime-node-modules.cjs:311

    }
  }
}

function findNodePtyConptySourceDir(nodePtyDir, windowsArch) {
  const conptyRoot = join(nodePtyDir, 'third_party', 'conpty')
  if (!existsSync(conptyRoot)) {
    throw new Error(`Packaged node-pty is missing ${conptyRoot}`)
  }
  for (const entry of readdirSync(conptyRoot, { withFileTypes: true })) {
    if (!entry.isDirectory()) {
      continue
    }
    const sourceDir = join(conptyRoot, entry.name, `win10-${windowsArch}`)
    if (existsSync(sourceDir)) {
      return sourceDir
    }
  }
  throw new Error(`Packaged node-pty has no ConPTY payload for win10-${windowsArch}`)
}

function ensurePackagedNodePtyConptyRuntime(nodePtyDir, electronArch) {
  const releaseDir = join(nodePtyDir, 'build', 'Release')
  if (!existsSync(join(releaseDir, 'conpty.node'))) {
    return
  }

  const runtimeDir = join(releaseDir, 'conpty')
  const missingRuntimeFiles = NODE_PTY_CONPTY_RUNTIME_FILES.filter(
    (filename) => !existsSync(join(runtimeDir, filename))
  )
  if (missingRuntimeFiles.length === 0) {
    return
  }

  const windowsArch = normalizeNodePtyWindowsArch(electronArch)
  const sourceDir = findNodePtyConptySourceDir(nodePtyDir, windowsArch)

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Install node-pty prebuilds for the target arch: set npm_config_target_arch or use --target_arch=<arch> when running the install/rebuild so win10-<arch> is fetched.
  2. Inspect node_modules/node-pty/third_party/conpty/*/ to see which win10-* directories actually exist, then align electronArch to one of them.
  3. For arm64 Windows builds, ensure the install ran on a toolchain that emits arm64 prebuilds (or download the arm64 prebuilt tarball).
  4. If only one arch is realistically supported, gate the build matrix so electronArch cannot request the missing arch.

Example fix

// before — arm64 build with only x64 prebuilds present
// electron-builder --win --arm64

// after — install the arm64 prebuild first
// npm_config_target_arch=arm64 pnpm rebuild node-pty
// electron-builder --win --arm64
Defensive patterns

Strategy: validation

Validate before calling

const { existsSync, readdirSync } = require('node:fs')
const { join } = require('node:path')

function assertConptyArchPresent(nodePtyDir, arch) {
  const conptyRoot = join(nodePtyDir, 'third_party', 'conpty')
  const found = existsSync(conptyRoot) && readdirSync(conptyRoot, { withFileTypes: true })
    .filter((e) => e.isDirectory())
    .some((e) => existsSync(join(conptyRoot, e.name, `win10-${arch}`)))
  if (!found) {
    throw new Error(`No win10-${arch} ConPTY prebuild; install with npm_config_target_arch=${arch}`)
  }
}
// call before packaging for win32:
// assertConptyArchPresent(nodePtyDir, normalizeNodePtyWindowsArch(electronArch))

Try / catch

try {
  findNodePtyConptySourceDir(nodePtyDir, windowsArch)
} catch (error) {
  if (/no ConPTY payload for win10-/.test(error.message)) {
    throw new Error(`${error.message} Reinstall node-pty with npm_config_target_arch=${windowsArch}.`)
  }
  throw error
}

Prevention

When it happens

Trigger: electronArch resolves to arm64 but the installed node-pty prebuild only ships win10-x64 (or vice versa); a cross-arch Windows build (e.g. arm64 on an x64 host) was attempted without the matching prebuild artifact; the conpty vendor directory was partially pruned so only one arch remains.

Common situations: Building Windows arm64 from a CI image that only cached x64 prebuilds; mixing a custom electronArch string with a prebuild that does not match; node-pty prebuilds fetched for the host arch instead of the target arch during install.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/305b2d3f2d47643e. Report an issue: GitHub.