{"record":{"id":"9b1b663c594743c9","repo":"nodejs/node","slug":"unknown-token-id-or-value-id","errorCode":null,"errorMessage":"Unknown token id or value \"${id}\".","messagePattern":"Unknown token id or value \"(.+?)\"\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"deps/npm/lib/commands/token.js","lineNumber":132,"sourceCode":"    }\n\n    const json = this.npm.config.get('json')\n    const parseable = this.npm.config.get('parseable')\n    const toRemove = []\n    log.info('token', `removing ${toRemove.length} tokens`)\n    const tokens = await paginate('/-/npm/v1/tokens', this.npm.flatOptions)\n    for (const id of args) {\n      const matches = tokens.filter(token => token.key.indexOf(id) === 0)\n      if (matches.length === 1) {\n        toRemove.push(matches[0].key)\n      } else if (matches.length > 1) {\n        throw new Error(\n          `Token ID \"${id}\" was ambiguous, a new token may have been created since you last ran \\`npm token list\\`.`\n        )\n      } else {\n        const tokenMatches = tokens.some(t => id.indexOf(t.token) === 0)\n        if (!tokenMatches) {\n          throw new Error(`Unknown token id or value \"${id}\".`)\n        }\n\n        toRemove.push(id)\n      }\n    }\n    for (const tokenKey of toRemove) {\n      await otplease(this.npm, this.npm.flatOptions, opts =>\n        fetch(`/-/npm/v1/tokens/token/${tokenKey}`, {\n          ...opts,\n          method: 'DELETE',\n          ignoreBody: true,\n        })\n      )\n    }\n    if (json) {\n      output.buffer(toRemove)\n    } else if (parseable) {\n      output.standard(toRemove.join('\\t'))","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/npm/lib/commands/token.js#L114-L150","documentation":"Thrown by `npm token rm` when the id neither prefixes any token key nor is prefixed by any token value. The id simply does not correspond to any current auth token.","triggerScenarios":"After `matches.length === 0`, the check `tokens.some(t => id.indexOf(t.token) === 0)` is also false — the id is not a known token key prefix nor a known token value prefix.","commonSituations":"Token already revoked/expired; typo in the id; token belongs to a different account/registry; stale id copied from an old `npm token list`.","solutions":["Re-run `npm token list` to see current valid token ids and copy the exact one.","Confirm you are authenticated as the token owner and against the correct registry.","Check for typos and stray whitespace in the id argument."],"exampleFix":"// before\nnpm token rm 00000000-0000-0000   // wrong/expired id\n// after\nnpm token list   // copy exact id, then:\nnpm token rm <exact-id>","handlingStrategy":"validation","validationCode":"function findToken(id, tokens) {\n  const byKey = tokens.filter(t => t.key.indexOf(id) === 0)\n  if (byKey.length === 1) return byKey[0].key\n  const byValue = tokens.find(t => id.indexOf(t.token) === 0)\n  if (byValue) return id\n  throw new Error(`Unknown token id or value \"${id}\". Run \\`npm token list\\` for valid ids.`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy token ids directly from a fresh `npm token list` output.","Verify the registry/account matches the token's owner.","Trim whitespace from copied ids."],"tags":["token","revoke","not-found","npm-cli","auth"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}