{"record":{"id":"5bfab594d2cdbd44","repo":"oven-sh/bun","slug":"environment-variable-is-missing-name","errorCode":null,"errorMessage":"Environment variable is missing: ${name}","messagePattern":"Environment variable is missing: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/utils.mjs","lineNumber":41,"sourceCode":"export const isMacOS = process.platform === \"darwin\";\n// Node built for Termux/bionic reports \"android\"; CI models that as linux + abi=android.\nexport const isAndroid = process.platform === \"android\";\nexport const isLinux = process.platform === \"linux\" || isAndroid;\nexport const isFreeBSD = process.platform === \"freebsd\";\nexport const isPosix = isMacOS || isLinux || isFreeBSD;\n\nexport const isX64 = process.arch === \"x64\";\n\n/**\n * @param {string} name\n * @param {boolean} [required]\n * @returns {string}\n */\nexport function getEnv(name, required = true) {\n  const value = process.env[name];\n\n  if (required && !value) {\n    throw new Error(`Environment variable is missing: ${name}`);\n  }\n\n  return value;\n}\n\nexport const isBuildkite = getEnv(\"BUILDKITE\", false) === \"true\";\nexport const isGithubAction = getEnv(\"GITHUB_ACTIONS\", false) === \"true\";\nexport const isCI = getEnv(\"CI\", false) === \"true\" || isBuildkite || isGithubAction;\nexport const isDebug = getEnv(\"DEBUG\", false) === \"1\";\n\n/**\n * @param {string} name\n * @param {object} [options]\n * @param {boolean} [options.required]\n * @param {boolean} [options.redact]\n * @returns {string}\n */\nexport function getSecret(name, options = { required: true, redact: true }) {","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/utils.mjs#L23-L59","documentation":"Error \"Environment variable is missing: ${name}\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at scripts/utils.mjs:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}