{"record":{"id":"0b211b87a1efdadc","repo":"pnpm/pnpm","slug":"access-revoke-invalid-team","errorCode":"ACCESS_REVOKE_INVALID_TEAM","errorMessage":"Invalid team \"${scopeTeam}\". Format must be \"scope:team\".","messagePattern":"Invalid team \"(.+?)\"\\. Format must be \"scope:team\"\\.","errorType":"exception","errorClass":"PnpmError","httpStatus":null,"severity":"error","filePath":"pnpm11/registry-access/commands/src/access.ts","lineNumber":504,"sourceCode":"\n  if (!response.ok) {\n    await throwRegistryError(response, `grant ${permissions} access for ${scopeTeam} on`)\n  }\n\n  return `+${scopeTeam} (${permissions}): ${packageName}`\n}\n\nasync function revokeAccess (\n  opts: AccessOptions,\n  params: string[]\n): Promise<string> {\n  if (params.length < 1) {\n    throw new PnpmError('ACCESS_REVOKE_ARGS_REQUIRED', 'scope:team and package name are required (e.g., pnpm access revoke @scope:developers @scope/pkg)')\n  }\n\n  const scopeTeam = params[0]\n  if (!scopeTeam.includes(':')) {\n    throw new PnpmError('ACCESS_REVOKE_INVALID_TEAM', `Invalid team \"${scopeTeam}\". Format must be \"scope:team\".`)\n  }\n\n  const packageName = params[1]\n  if (!packageName) {\n    throw new PnpmError('ACCESS_REVOKE_PACKAGE_REQUIRED', 'Package name is required (e.g., pnpm access revoke @scope:developers @scope/pkg)')\n  }\n\n  const [scope, team] = scopeTeam.split(':')\n  const registriesByScope = getRegistries(opts)\n  const registryUrl = pickRegistryForPackage(registriesByScope, packageName)\n  const authHeader = getAuthHeaderForRegistry(opts.configByUri, registryUrl, packageName)\n  const fetchFromRegistry = createFetchFromRegistry(opts)\n  const otp = opts.cliOptions?.otp\n\n  const revokeUrl = new URL(`-/team/${encodeURIComponent(scope.startsWith('@') ? scope.slice(1) : scope)}/${encodeURIComponent(team)}/package`, normalizeRegistryUrl(registryUrl)).href\n  const response = await fetchFromRegistry(revokeUrl, {\n    authHeaderValue: authHeader,\n    method: 'DELETE',","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/pnpm/pnpm/blob/6261b7f388016d57ca6b90340342411cd1d0d00f/pnpm11/registry-access/commands/src/access.ts#L486-L522","documentation":"Thrown by `pnpm access revoke` when the first argument does not contain a colon. Like the grant path, revokeAccess splits the team specifier on `:` to build the `/-team/<scope>/<team>/package` URL for the DELETE request, so a value without the `scope:team` shape is rejected client-side. The check is purely syntactic — it does not confirm the team exists on the registry.","triggerScenarios":"`pnpm access revoke developers @scope/pkg` or `pnpm access revoke @myscope @scope/pkg` — any params[0] failing `scopeTeam.includes(':')`.","commonSituations":"Omitting the scope prefix because it seems implied by the package; pasting a team name copied from a notification that dropped the scope; typo such as replacing the colon with a dash or space.","solutions":["Use the full `scope:team` form: `pnpm access revoke @myscope:developers @scope/pkg`.","List existing teams with `pnpm team ls @myscope` to get the exact team name.","Verify the separator is an ASCII colon."],"exampleFix":"# before\npnpm access revoke developers @scope/pkg\n\n# after\npnpm access revoke @myscope:developers @scope/pkg","handlingStrategy":"validation","validationCode":"if (!scopeTeam.includes(':')) {\n  throw new Error(`team must be in \"scope:team\" format, got \"${scopeTeam}\"`)\n}\nawait handler(opts, ['revoke', scopeTeam, packageName])","typeGuard":"function isScopeTeamSpec (value: string): value is `${string}:${string}` {\n  const parts = value.split(':')\n  return parts.length === 2 && parts[0].length > 0 && parts[1].length > 0\n}","tryCatchPattern":"try {\n  await handler(opts, ['revoke', scopeTeam, packageName])\n} catch (err) {\n  if ('code' in err && (err as { code: string }).code === 'ACCESS_REVOKE_INVALID_TEAM') {\n    // fix the team format (prepend the scope) and retry\n  } else {\n    throw err\n  }\n}","preventionTips":["Use one shared `scope:team` formatter for grant and revoke code paths.","Source team names from `pnpm team ls` output rather than free-text input.","Reject user input containing a dash or space where the colon separator is expected."],"tags":["cli","access","revoke","team","argument-validation"],"backgroundTag":"invalid-argument-format","analyzedSha":"6261b7f388016d57ca6b90340342411cd1d0d00f","analyzedAt":"2026-08-17T18:30:54.750Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}