Skip to content

npm installer pulls 41 transitive dependencies via axios — consider bundled binary approach #2360

@zeroows

Description

@zeroows

Problem

The npm installer generated by cargo-dist uses a JS downloader approach that brings in 5 direct runtime dependencies:

This results in 41 packages installed for what is fundamentally a single static binary. For comparison, tools like esbuild, swc, and biome use platform-specific optional dependencies (@esbuild/linux-x64, etc.) that contain the binary directly — zero runtime JS dependencies, no postinstall download step.

$ npm install @silafood/runsteps@0.1.0
41 packages installed

Suggestion

Consider offering a bundled binary strategy (as described in #450) where:

  1. Platform-specific packages (@scope/tool-linux-x64, @scope/tool-darwin-arm64, etc.) each contain the prebuilt binary
  2. The root package lists them as optionalDependencies
  3. npm/bun/pnpm automatically picks the right one for the platform

This eliminates:

  • All 5 runtime dependencies (axios, detect-libc, rimraf, console.table, axios-proxy-builder)
  • The postinstall download step (binary is already in the package)
  • Network failures during install (no GitHub fetch at install time)
  • The 41-package dependency tree

Current workaround

Using the shell installer (curl | sh) or Homebrew instead of npm, since those have zero dependencies.

Environment

  • cargo-dist 0.31.0
  • installers = ["shell", "npm", "homebrew"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions