{"record":{"id":"adb886cfe8f9a162","repo":"denoland/deno","slug":"could-not-get-fetch-esbuild-binary-download-it-ma","errorCode":null,"errorMessage":"could not get fetch esbuild binary; download it manually and copy it to {}","messagePattern":"could not get fetch esbuild binary; download it manually and copy it to (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/bundle/esbuild.rs","lineNumber":151,"sourceCode":"            \"failed to move esbuild binary into place at {}\",\n            esbuild_path.display()\n          )\n        });\n      }\n    }\n\n    if !existed {\n      let _ = std::fs::remove_dir_all(&package_folder).inspect_err(|e| {\n        log::warn!(\n          \"failed to remove directory {}: {}\",\n          package_folder.display(),\n          e\n        );\n      });\n    }\n    Ok(esbuild_path)\n  } else {\n    anyhow::bail!(\n      \"could not get fetch esbuild binary; download it manually and copy it to {}\",\n      esbuild_path.display()\n    );\n  }\n}\n","sourceCodeStart":133,"sourceCodeEnd":157,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/bundle/esbuild.rs#L133-L157","documentation":"deno bundle shells out to esbuild, fetching the pinned esbuild npm package on first use and copying its platform binary into DENO_DIR. This bail (cli/tools/bundle/esbuild.rs:150-155) fires when the registry metadata for the pinned esbuild version carries no dist tarball information (version_info.dist is None), so there is nothing to download - typical of broken mirrors, custom registries lacking the package, or proxied/offline environments. The message names the exact path where the binary is expected so it can be installed manually.","triggerScenarios":"npm registry metadata reachable but missing the dist field for the pinned esbuild version (misconfigured mirror, allowlist-style proxy, air-gapped Artifactory/Verdaccio feed without esbuild); registry returning truncated metadata; unusual ESBUILD_VERSION pin not present in the mirror.","commonSituations":"Corporate networks with a private npm registry that doesn't proxy esbuild; offline/air-gapped build agents; registry outages serving degraded metadata; DENO_DIR on read-only or full disk making earlier install steps silently unavailable.","solutions":["Check registry connectivity/config: verify the registry URL in npmrc (.npmrc registry=, DENO_ env overrides) and that it serves the esbuild package with dist for the pinned version","Retry after fixing network/proxy (the earlier download attempts log 'failed to download esbuild package tarball ...' when the tarball itself fails)","Manually install: download the esbuild binary matching the pinned version for your platform, make it executable, and copy it to the exact path printed in the error (under DENO_DIR; find it via 'deno info')","Run once from a machine with normal registry access, then copy the cached binary into the same DENO_DIR path on the restricted machine"],"exampleFix":"# before: fails with 'could not get fetch esbuild binary; download it manually and copy it to /home/ci/.cache/deno/esbuild-...'\ndeno bundle src/main.ts out.js\n# after: manual install on the restricted host\nESBUILD_PATH=$(deno info | grep 'DENO_DIR' || true)\n# take the path from the error message, then:\ncp ./tools/esbuild-linux-x64 /home/ci/.cache/deno/esbuild-X_Y_Z/esbuild\nchmod +x /home/ci/.cache/deno/esbuild-X_Y_Z/esbuild\ndeno bundle src/main.ts out.js","handlingStrategy":"fallback","validationCode":"# Verify the registry serves the pinned esbuild package with a dist tarball\nESBUILD_VERSION=$(deno --version | head -1)  # or read from the error message\ncurl -fsS \"${NPM_REGISTRY:-https://registry.npmjs.org}/esbuild\" \\\n  | jq -e --arg v \"$ESBUILD_VERSION\" '.versions[$v].dist.tarball' >/dev/null \\\n  && echo 'esbuild dist available' || echo 'registry missing esbuild dist - pre-install manually'","typeGuard":null,"tryCatchPattern":"# Pre-seed the binary from a mirror, then run the bundle\nERRLOG=$(mktemp)\ndeno bundle src/main.ts out.js 2>&1 | tee \"$ERRLOG\" || {\n  path=$(sed -n 's/.*copy it to \\(.*\\)/\\1/p' \"$ERRLOG\")\n  [ -n \"$path\" ] && cp ./vendor/esbuild \"$path\" && chmod +x \"$path\" && deno bundle src/main.ts out.js\n}","preventionTips":["On restricted networks, pre-install the pinned esbuild binary into DENO_DIR during image build","Point npmrc at a registry that proxies the public npm registry including esbuild","Keep an offline copy of the esbuild binary next to other vendored toolchain artifacts"],"tags":["esbuild","bundle","npm-registry","network","offline"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}