{"record":{"id":"0abf57827e46e723","repo":"parcel-bundler/parcel","slug":"npmfetch-failed-fetching-tarball-res-statu","errorCode":null,"errorMessage":"npmFetch failed: fetching ${tarball} - ${res.status}","messagePattern":"npmFetch failed: fetching (.+?) - (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/repl/SimplePackageInstaller/index.js","lineNumber":110,"sourceCode":"        `${name}@${version}: only npm semver dependencies are currently supported.`,\n      );\n    }\n    this.cache.resolve.set(\n      `${name}@${version}`,\n      data.versions[resolvedVersion],\n    );\n    return data.versions[resolvedVersion];\n  }\n\n  async _npmFetch(tarball: string): Promise<Map<string, Uint8Array>> {\n    const cacheEntry = this.cache.fetch.get(tarball);\n    if (cacheEntry) {\n      return cacheEntry;\n    }\n\n    const res = await fetch(tarball);\n    if (!res.ok) {\n      throw new Error(`npmFetch failed: fetching ${tarball} - ${res.status}`);\n    }\n\n    let result;\n    if (!res.arrayBuffer) {\n      // node\n      var bufs = [];\n      res.body.on('data', function (d) {\n        bufs.push(d);\n      });\n\n      const buffer = await new Promise(resolve =>\n        res.body.on('end', () => {\n          resolve(Buffer.concat(bufs));\n        }),\n      );\n\n      result = new ArrayBuffer(buffer.length);\n      var view = new Uint8Array(result);","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/dev/repl/SimplePackageInstaller/index.js#L92-L128","documentation":"Thrown by `SimplePackageInstaller._npmFetch` when the HTTP GET against a package's tarball URL (from `dist.tarball`) returns a non-2xx status. Resolution succeeded but the actual artifact download failed. The tarball URL and status are appended.","triggerScenarios":"Tarball URL is stale/unpublished (404); CDN rate-limit (429); transient CDN error (5xx); mirrored/private registry where the tarball host is unreachable; integrity/unpublish happened between resolve and fetch.","commonSituations":"Package was unpublished or version yanked mid-session; CDN outage; corporate proxy blocks the tarball CDN host; very large package timing out at the edge.","solutions":["Retry — most tarball fetch failures are transient CDN errors.","Check the status code in the message: 404 → the version was removed, re-resolve for a current one.","Verify network access to the tarball host shown in the message.","If reproducible, report with the exact tarball URL and status."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"async function tarballOk(url) {\n  const r = await fetch(url, { method: 'HEAD' });\n  return r.ok;\n}","typeGuard":null,"tryCatchPattern":"try { await installer._npmFetch(tarball); }\ncatch (e) {\n  if (/npmFetch failed: .* - (429|5\\d\\d)/.test(e.message)) { await backoffRetry(() => installer._npmFetch(tarball)); }\n  else throw e;\n}","preventionTips":["Retry transient CDN errors with backoff.","Cache successful fetches (the installer already does — reuse the instance).","On repeated 404, re-resolve the version."],"tags":["network","npm","tarball","repl"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}