{"record":{"id":"4078fbde7d79f438","repo":"oven-sh/bun","slug":"unsupported-operating-system-string","errorCode":null,"errorMessage":"Unsupported operating system: ${string}","messagePattern":"Unsupported operating system: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/utils.mjs","lineNumber":1372,"sourceCode":"\n/**\n * @param {string} string\n * @returns {\"darwin\" | \"linux\" | \"windows\" | \"freebsd\"}\n */\nexport function parseOs(string) {\n  if (/darwin|apple|mac/i.test(string)) {\n    return \"darwin\";\n  }\n  if (/linux|android/i.test(string)) {\n    return \"linux\";\n  }\n  if (/freebsd/i.test(string)) {\n    return \"freebsd\";\n  }\n  if (/win/i.test(string)) {\n    return \"windows\";\n  }\n  throw new Error(`Unsupported operating system: ${string}`);\n}\n\n/**\n * @returns {\"darwin\" | \"linux\" | \"windows\" | \"freebsd\"}\n */\nexport function getOs() {\n  return parseOs(process.platform);\n}\n\n/**\n * @param {string} string\n * @returns {\"x64\" | \"aarch64\"}\n */\nexport function parseArch(string) {\n  if (/x64|amd64|x86_64/i.test(string)) {\n    return \"x64\";\n  }\n  if (/arm64|aarch64/i.test(string)) {","sourceCodeStart":1354,"sourceCodeEnd":1390,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/utils.mjs#L1354-L1390","documentation":"parseOs() maps a free-form OS string onto Bun's canonical set {darwin, linux, windows, freebsd} using regex heuristics (e.g. /darwin|apple|mac/, /win/). When the input matches none of the known families, this generic validation guard fires and echoes the offending string, so callers can see which unrecognized platform identifier (typically from a CLI flag, env var, or triple) failed to parse.","triggerScenarios":"Thrown at scripts/utils.mjs:1372 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a recognizable OS string (e.g. darwin, linux, windows, freebsd)","Add a pattern if a legitimately new OS target is introduced"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","contentChangedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}