{"record":{"id":"2bd79b6225de3580","repo":"Budibase/budibase","slug":"npm-package-not-found","errorCode":null,"errorMessage":"NPM Package not found","messagePattern":"NPM Package not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/api/controllers/plugin/npm.ts","lineNumber":48,"sourceCode":"  let pluginName = name\n\n  const parsedInput = parseNpmUrl(npmTarballUrl)\n  if (!isAllowedNpmHost(parsedInput.hostname)) {\n    throw new Error(\"The plugin origin must be from NPM\")\n  }\n\n  if (!npmTarballUrl.includes(\".tgz\")) {\n    if (\n      parsedInput.hostname !== \"www.npmjs.com\" ||\n      !parsedInput.pathname.startsWith(\"/package/\")\n    ) {\n      throw new Error(\"The plugin origin must be from NPM\")\n    }\n    const packageName = parsedInput.pathname.replace(\"/package/\", \"\").trim()\n    const npmPackageURl = `https://registry.npmjs.org/${packageName}`\n    const response = await coreUtils.fetchWithBlacklist(npmPackageURl)\n    if (response.status !== 200) {\n      throw new Error(\"NPM Package not found\")\n    }\n\n    let npmDetails = await response.json()\n    pluginName = npmDetails.name\n    const npmVersion = npmDetails[\"dist-tags\"].latest\n    npmTarballUrl = npmDetails?.versions?.[npmVersion]?.dist?.tarball\n\n    if (!npmTarballUrl) {\n      throw new Error(\"NPM tarball url not found\")\n    }\n  }\n\n  const path = await downloadUnzipTarball(npmTarballUrl, pluginName, headers)\n  const pluginRoot = join(path, \"package\", \"dist\")\n  try {\n    return await getPluginMetadata(pluginRoot, path)\n  } catch (err) {\n    deleteFolderFileSystem(path)","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/api/controllers/plugin/npm.ts#L30-L66","documentation":"Thrown when the registry lookup for the NPM package (https://registry.npmjs.org/<name>) returns a status other than 200, meaning the package name extracted from the URL does not resolve on the public NPM registry.","triggerScenarios":"Uploading a plugin via a www.npmjs.com/package/<name> URL where <name> does not exist on the registry, was unpublished, or is private/unscoped incorrectly encoded; also registry outages returning non-200.","commonSituations":"Typos in package name; package unpublished or renamed; scoped private packages not on public registry; corporate proxy blocking registry.npmjs.org so fetch fails with non-200.","solutions":["Verify the package exists: curl https://registry.npmjs.org/<packageName>","Check the package was not unpublished or renamed","Confirm network/proxy access to registry.npmjs.org from the server","Publish the plugin package to NPM if it is new"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const res = await fetch(`https://registry.npmjs.org/${packageName}`)\nif (res.status !== 200) throw new Error(`Package ${packageName} not found on NPM registry`)","typeGuard":null,"tryCatchPattern":"try {\n  await npmUpload({ input })\n} catch (err) {\n  if (err.message === 'NPM Package not found') {\n    // verify package name on https://registry.npmjs.org before retrying\n  }\n}","preventionTips":["Check the package exists on npmjs.com before uploading its page URL","Confirm the package is not unpublished/private","Test registry reachability from the server (proxy/firewall)"],"tags":["npm","network","plugins"],"backgroundTag":"npm-package-not-found","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}