{"record":{"id":"4b475cd4c0a41715","repo":"nodejs/node","slug":"project-id-is-required","errorCode":null,"errorMessage":"project-id is required","messagePattern":"project-id is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"deps/npm/lib/commands/trust/circleci.js","lineNumber":132,"sourceCode":"    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) {\n        this.validateUuid(contextId, 'context-id')\n      }\n    }","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/npm/lib/commands/trust/circleci.js#L114-L150","documentation":"Thrown by the CircleCI trust provider's `flagsToOptions` when the `--project-id` flag is missing or empty. The project UUID is required to scope the trust record to a specific CircleCI project.","triggerScenarios":"`flags['project-id']` is falsy during required-flag validation (checked after org-id).","commonSituations":"Mixing up org-id and project-id; omitting the flag; passing the project slug instead of its UUID.","solutions":["Pass `--project-id <uuid>` with the CircleCI project UUID.","Obtain it from CircleCI Project Settings; it must be a UUID (`validateUuid` runs next).","Distinguish org-id (organization level) from project-id (repository level)."],"exampleFix":"// before\nnpm trust circleci mypkg --org-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, 'project-id')","typeGuard":"function hasProjectId(flags) {\n  return Boolean(flags && flags['project-id'])\n}","tryCatchPattern":null,"preventionTips":["Distinguish project-id (repo-level) from org-id (org-level).","Source both from CircleCI's settings UI as UUIDs.","Validate flag presence in a preflight wrapper."],"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"}