{"record":{"id":"9c18683289b02229","repo":"nodejs/node","slug":"vcs-origin-is-required","errorCode":null,"errorMessage":"vcs-origin is required","messagePattern":"vcs-origin is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"deps/npm/lib/commands/trust/circleci.js","lineNumber":138,"sourceCode":"\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) {\n        this.validateUuid(contextId, 'context-id')\n      }\n    }\n\n    return {\n      values: {\n        package: pkgName,\n        orgId,\n        projectId,","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/npm/lib/commands/trust/circleci.js#L120-L156","documentation":"Thrown by the CircleCI trust provider's `flagsToOptions` when the `--vcs-origin` flag is missing or empty. The VCS origin (`provider/owner/repo`) anchors the OIDC claim to a source repository, so it is required.","triggerScenarios":"`flags['vcs-origin']` is falsy during required-flag validation (the last required check before format validation).","commonSituations":"Forgetting the flag; assuming it is derived from the project; CI templates that don't forward the repository coordinates.","solutions":["Pass `--vcs-origin github.com/owner/repo` (no scheme; see the format validators).","Derive it from the checkout URL in CI and strip the scheme.","Ensure both presence and the `provider/owner/repo` format to avoid the follow-up validation errors."],"exampleFix":"// before\nnpm trust circleci mypkg --org-id <uuid> --project-id <uuid> --pipeline-definition-id <uuid>\n// after\nnpm trust circleci mypkg --org-id <uuid> --project-id <uuid> --pipeline-definition-id <uuid> --vcs-origin github.com/owner/repo","handlingStrategy":"validation","validationCode":"function assertRequiredFlag(flags, name) {\n  if (!flags[name]) throw new Error(`${name} is required`)\n  return flags[name]\n}\nassertRequiredFlag(flags, 'vcs-origin')","typeGuard":"function hasVcsOrigin(flags) {\n  return Boolean(flags && flags['vcs-origin'])\n}","tryCatchPattern":null,"preventionTips":["Derive vcs-origin from CI checkout coordinates and strip the scheme.","Provide all required CircleCI flags in one consistent template.","Remember vcs-origin also has a format check (provider/owner/repo)."],"tags":["trust","circleci","required-flag","vcs-origin","argument-validation","oidc"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}