{"record":{"id":"50649ce52a423380","repo":"nodejs/node","slug":"no-dist-tags-found-for-spec-name","errorCode":null,"errorMessage":"No dist-tags found for ${spec.name}","messagePattern":"No dist-tags found for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"deps/npm/lib/commands/dist-tag.js","lineNumber":200,"sourceCode":"        output.standard(`${name}:`)\n        await this.list(npa(name), this.npm.flatOptions)\n      } catch {\n        // set the exitCode directly, but ignore the error since it will have already been logged by this.list()\n        process.exitCode = 1\n      }\n    }\n  }\n\n  async fetchTags (spec, opts) {\n    const data = await npmFetch.json(\n      `/-/package/${spec.escapedName}/dist-tags`,\n      { ...opts, 'prefer-online': true, spec }\n    )\n    if (data && typeof data === 'object') {\n      delete data._etag\n    }\n    if (!data || !Object.keys(data).length) {\n      throw new Error('No dist-tags found for ' + spec.name)\n    }\n\n    return data\n  }\n}\n\nmodule.exports = DistTag\n","sourceCodeStart":182,"sourceCodeEnd":208,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/npm/lib/commands/dist-tag.js#L182-L208","documentation":"fetchTags() queries the registry's dist-tags endpoint and throws if the response is missing or empty (no keys). This typically means the package has no published versions yet, or the package does not exist on this registry.","triggerScenarios":"Running dist-tag ls/add/rm against a never-published package name; a private registry returning an empty 200; a typo'd package name that resolves to nothing.","commonSituations":"Bootstrapping a new package before first publish; scoped package name mismatch; mirror/registry that lacks the package.","solutions":["Confirm the package exists and is published: `npm view <pkg>`","Publish at least one version, which creates the initial `latest` tag","Verify the registry URL and scope mapping in .npmrc"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"async function packageHasTags(fetch, escapedName) {\n  const data = await fetch.json(`/-/package/${escapedName}/dist-tags`, { 'prefer-online': true })\n  return data && typeof data === 'object' && Object.keys(data).length > 0\n}","typeGuard":"function hasDistTags(data) {\n  return !!data && typeof data === 'object' && Object.keys(data).filter(k => k !== '_etag').length > 0\n}","tryCatchPattern":"try {\n  await operateOnTags(pkg)\n} catch (e) {\n  if (/No dist-tags found/.test(e.message)) { /* publish first or fix name */ }\n  else throw e\n}","preventionTips":["Confirm the package is published with `npm view` before tag operations","Verify scope/registry mapping in .npmrc","Bootstrap new packages with a first publish before any tag automation"],"tags":["dist-tag","registry","cli","publishing"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}