{"record":{"id":"5b54b9d61ef4b94a","repo":"janhq/jan","slug":"unsupported-platform-platform","errorCode":null,"errorMessage":"Unsupported platform: ${platform}","messagePattern":"Unsupported platform: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/download-bin.mjs","lineNumber":148,"sourceCode":"  const arch = os.arch() // 'x64', 'arm64', etc.\n\n  let bunPlatform, uvPlatform\n\n  if (platform === 'darwin') {\n    bunPlatform = arch === 'arm64' ? 'darwin-aarch64' : 'darwin-x64'\n    uvPlatform =\n      arch === 'arm64' ? 'aarch64-apple-darwin' : 'x86_64-apple-darwin'\n  } else if (platform === 'linux') {\n    bunPlatform = arch === 'arm64' ? 'linux-aarch64' : 'linux-x64'\n    uvPlatform =\n      arch === 'arm64'\n        ? 'aarch64-unknown-linux-gnu'\n        : 'x86_64-unknown-linux-gnu'\n  } else if (platform === 'win32') {\n    bunPlatform = 'windows-x64' // Bun has limited Windows support\n    uvPlatform = 'x86_64-pc-windows-msvc'\n  } else {\n    throw new Error(`Unsupported platform: ${platform}`)\n  }\n\n  return { bunPlatform, uvPlatform }\n}\n\nasync function main() {\n  if (process.env.SKIP_BINARIES) {\n    console.log('Skipping binaries download.')\n    process.exit(0)\n  }\n  console.log('Starting main function')\n  const platform = os.platform()\n  const { bunPlatform, uvPlatform } = getPlatformArch()\n  console.log(`bunPlatform: ${bunPlatform}, uvPlatform: ${uvPlatform}`)\n\n  const binDir = 'src-tauri/resources/bin'\n  const tempBinDir = 'scripts/dist'\n  const bunPath = `${tempBinDir}/bun-${bunPlatform}.zip`","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/janhq/jan/blob/fad3f12a147d138388a66f0d92a02b2675f65294/scripts/download-bin.mjs#L130-L166","documentation":"Thrown by getPlatformArch() in scripts/download-bin.mjs when os.platform() returns a value other than 'darwin', 'linux', or 'win32'. The binary-fetch step (bun, uv, sqlite-vec) only ships prebuilt assets for those three OSes, so any other platform aborts the setup rather than downloading a wrong-arch binary.","triggerScenarios":"Running `node scripts/download-bin.mjs` on FreeBSD, OpenBSD, SunOS/Solaris, AIX, or Android; running under a Node build that reports an unexpected platform string.","commonSituations":"Building on an uncommon OS; CI on a minimal container whose os.platform() is unexpected; attempting a native build instead of using the download path.","solutions":["Run the setup on a supported platform (macOS, Linux, or Windows).","Set SKIP_BINARIES=1 to skip the download step if binaries are provided another way.","Manually place bun/uv binaries in scripts/dist matching the expected naming and bypass the script.","Extend getPlatformArch to map your platform if you can self-host the prebuilts."],"exampleFix":"// before\nconst { bunPlatform, uvPlatform } = getPlatformArch()\n\n// after (run)\nSKIP_BINARIES=1 node scripts/download-bin.mjs\n\n// or extend the function for your platform (e.g. freebsd) before calling","handlingStrategy":"validation","validationCode":"import os from 'os'\nconst SUPPORTED = new Set(['darwin', 'linux', 'win32'])\nif (!SUPPORTED.has(os.platform())) {\n  if (!process.env.SKIP_BINARIES) {\n    throw new Error(`Set SKIP_BINARIES=1 or run on macOS/Linux/Windows (got ${os.platform()})`)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the binary download step only on macOS, Linux, or Windows.","Set SKIP_BINARIES=1 if you provide binaries another way.","Gate the script behind a platform check in CI."],"tags":["build","platform","setup","node","binaries"],"backgroundTag":null,"analyzedSha":"fad3f12a147d138388a66f0d92a02b2675f65294","analyzedAt":"2026-08-12T20:33:47.516Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}