{"record":{"id":"8c49c44b692e1cf3","repo":"nodejs/node","slug":"org-id-is-required","errorCode":null,"errorMessage":"org-id is required","messagePattern":"org-id is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"deps/npm/lib/commands/trust/circleci.js","lineNumber":129,"sourceCode":"\n  // Override flagsToOptions since CircleCI doesn't use file/entity pattern\n  async flagsToOptions ({ positionalArgs, flags }) {\n    const content = await this.optionalPkgJson()\n    const pkgName = positionalArgs[0] || content.name\n\n    if (!pkgName) {\n      throw new Error('Package name must be specified either as an argument or in package.json file')\n    }\n\n    const orgId = flags['org-id']\n    const projectId = flags['project-id']\n    const pipelineDefinitionId = flags['pipeline-definition-id']\n    const vcsOrigin = flags['vcs-origin']\n    const contextIds = flags['context-id']\n\n    // Validate required flags\n    if (!orgId) {\n      throw new Error('org-id is required')\n    }\n    if (!projectId) {\n      throw new Error('project-id is required')\n    }\n    if (!pipelineDefinitionId) {\n      throw new Error('pipeline-definition-id is required')\n    }\n    if (!vcsOrigin) {\n      throw new Error('vcs-origin is required')\n    }\n\n    // Validate formats\n    this.validateUuid(orgId, 'org-id')\n    this.validateUuid(projectId, 'project-id')\n    this.validateUuid(pipelineDefinitionId, 'pipeline-definition-id')\n    this.validateVcsOrigin(vcsOrigin)\n    if (contextIds?.length > 0) {\n      for (const contextId of contextIds) {","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/npm/lib/commands/trust/circleci.js#L111-L147","documentation":"Thrown by the CircleCI trust provider's `flagsToOptions` when the `--org-id` flag is missing or empty. The CircleCI organization UUID is a required binding for the trust record.","triggerScenarios":"`flags['org-id']` is falsy when `flagsToOptions` runs its required-flag validation block.","commonSituations":"Forgetting the flag; copying a project id but not the org id; CI template that omits the org-level identifier.","solutions":["Pass `--org-id <uuid>` with the CircleCI organization UUID.","Find it in CircleCI under Organization Settings; it must be a valid UUID (also validated by `validateUuid`).","Store it in CI secrets and interpolate it into the command."],"exampleFix":"// before\nnpm trust circleci mypkg --project-id <uuid> ...\n// after\nnpm trust circleci mypkg --org-id <uuid> --project-id <uuid> ...","handlingStrategy":"validation","validationCode":"function assertRequiredFlag(flags, name) {\n  if (!flags[name]) throw new Error(`${name} is required`)\n  return flags[name]\n}\nassertRequiredFlag(flags, 'org-id')","typeGuard":"function hasOrgId(flags) {\n  return Boolean(flags && flags['org-id'])\n}","tryCatchPattern":null,"preventionTips":["Store org-id in CI secrets and inject it deterministically.","Keep a checklist of required CircleCI flags for the trust command.","Validate all required flags in a wrapper before invoking npm."],"tags":["trust","circleci","required-flag","argument-validation","oidc"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}