{"record":{"id":"af70f1dc1b4f23de","repo":"pnpm/pnpm","slug":"no-bugs-url","errorCode":"NO_BUGS_URL","errorMessage":"The current project does not have a bug tracker URL. Add a \"bugs\" or \"repository\" field to its manifest.","messagePattern":"The current project does not have a bug tracker URL\\. Add a \"bugs\" or \"repository\" field to its manifest\\.","errorType":"exception","errorClass":"PnpmError","httpStatus":null,"severity":"error","filePath":"pnpm11/deps/inspection/commands/src/bugs/index.ts","lineNumber":55,"sourceCode":"    ? [await getBugsUrlFromCurrentProject(opts)]\n    : await Promise.all(params.map((spec) => getBugsUrlFromRegistry(opts, spec)))\n  for (const url of urls) {\n    // eslint-disable-next-line no-await-in-loop\n    await open(url)\n  }\n}\n\nasync function getBugsUrlFromCurrentProject (\n  opts: Pick<Config, 'dir' | 'engineStrict' | 'nodeVersion' | 'supportedArchitectures'>\n): Promise<string> {\n  const manifest = await readProjectManifestOnly(opts.dir, {\n    engineStrict: opts.engineStrict,\n    nodeVersion: opts.nodeVersion,\n    supportedArchitectures: opts.supportedArchitectures,\n  })\n  const url = pickBugsUrl({ bugs: manifest.bugs, repository: manifest.repository })\n  if (!url) {\n    throw new PnpmError(\n      'NO_BUGS_URL',\n      'The current project does not have a bug tracker URL. Add a \"bugs\" or \"repository\" field to its manifest.'\n    )\n  }\n  return url\n}\n\nasync function getBugsUrlFromRegistry (\n  opts: Config & ConfigContext,\n  packageSpec: string\n): Promise<string> {\n  const info = await fetchPackageInfo(opts, packageSpec)\n  const url = pickBugsUrl({ bugs: info.bugs, repository: info.repository })\n  if (!url) {\n    throw new PnpmError('NO_BUGS_URL', `The package \"${info.name}\" does not have a bug tracker URL.`)\n  }\n  return url\n}","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/pnpm/pnpm/blob/5b11d3a15b9022a2109cb18ed96a5d652630371f/pnpm11/deps/inspection/commands/src/bugs/index.ts#L37-L73","documentation":"Thrown by `pnpm bugs` when run in the current project and the project manifest yields no usable bug tracker URL. pickBugsUrl only accepts an http(s) URL from the `bugs` field (string or {url}) or, failing that, the `repository` field — a missing or non-http value (e.g. a bugs field that is only an email) leaves nothing to open.","triggerScenarios":"Running `pnpm bugs` in a package.json with no `bugs` and no `repository` field; having `bugs: { email: ... }` with no url and no repository; repository set to a non-URL shorthand that pickBugsUrl cannot turn into an http(s) link.","commonSituations":"New scaffolds generated from minimal templates; private packages never given repository metadata; manifests where repository is an object with only a `directory` key.","solutions":["Add a \"bugs\" field with an http(s) URL to package.json (e.g. \"bugs\": { \"url\": \"https://github.com/user/repo/issues\" })","Or add a \"repository\" field whose URL can be resolved to the tracker","If you only have an email, note that `pnpm bugs` will not open it — a URL is required"],"exampleFix":"// before\n{\n  \"name\": \"my-pkg\"\n}\n\n// after\n{\n  \"name\": \"my-pkg\",\n  \"bugs\": { \"url\": \"https://github.com/user/my-pkg/issues\" }\n}","handlingStrategy":"validation","validationCode":"import fs from 'node:fs'\n\nconst manifest = JSON.parse(fs.readFileSync('package.json', 'utf8'))\nconst hasBugsUrl = typeof manifest.bugs === 'string' || typeof manifest.bugs?.url === 'string' || manifest.repository != null\nif (!hasBugsUrl) {\n  throw new Error('add a \"bugs\" or \"repository\" field before running pnpm bugs')\n}","typeGuard":"function hasHttpBugsUrl (m: { bugs?: string | { url?: string } }): boolean {\n  const url = typeof m.bugs === 'string' ? m.bugs : m.bugs?.url\n  return url != null && /^https?:\\/\\//.test(url)\n}","tryCatchPattern":"try {\n  await bugsCmd(opts)\n} catch (err) {\n  if (err instanceof PnpmError && err.code === 'NO_BUGS_URL') {\n    // open the package page instead, or print the missing-manifest-field hint\n  } else throw err\n}","preventionTips":["Include a \"bugs\" URL in every package.json your tooling scaffolds","Use full http(s) URLs, not email-only bugs fields or git shorthands"],"tags":["bugs","manifest","cli"],"backgroundTag":null,"analyzedSha":"5b11d3a15b9022a2109cb18ed96a5d652630371f","analyzedAt":"2026-08-16T13:18:59.198Z","schemaVersion":2},"datasetVersion":"2026-08-16T18:17:16.020Z"}