Skip to content

Stop silently installing the devcontainer CLI from the npm registry - #29

Merged
aniongithub merged 1 commit into
mainfrom
aniongithub-fix-npm-silent-install
Aug 2, 2026
Merged

Stop silently installing the devcontainer CLI from the npm registry#29
aniongithub merged 1 commit into
mainfrom
aniongithub-fix-npm-silent-install

Conversation

@aniongithub

Copy link
Copy Markdown
Owner

Problem

install.sh auto-installed the devcontainer CLI by piping the devcontainers/cli standalone installer to sh with all output suppressed (>/dev/null 2>&1). That installer fetches @devcontainers/cli from registry.npmjs.org, which corporate egress policies — e.g. Microsoft Defender's "[TE] NPM URL Block" — intercept.

Because it ran silently:

  • The user never saw that a network download was happening.
  • When the registry was blocked, the failure was invisible (swallowed output), leaving a confusing broken state.

Fix

Make the devcontainer CLI detect-only, consistent with how devpod and gh are already handled:

  • Removed the install_devcontainer_cli() function and the silent curl … | sh pipe.
  • The installer now just reports presence:
    • ✓ devcontainer when found, or
    • ✗ devcontainer — https://github.com/devcontainers/cli#install-script (or 'brew install devcontainer') when missing (the brew bottle avoids the npm registry entirely).
  • Updated the header comment: "Nothing is downloaded silently on your behalf."

install.ps1 needs no change — it only detects devcontainer in WSL and delegates the binary install to install.sh, so the silent fetch is gone from the Windows/WSL path too. The README already documents manual devcontainer CLI install.

Testing

  • bash -n install.sh passes.
  • Net change: 8 insertions, 29 deletions (one file).

install.sh auto-installed @devcontainers/cli by piping the devcontainers/cli
standalone installer to sh with all output suppressed. That fetches from
registry.npmjs.org, which corporate egress policies (e.g. Microsoft Defender's
NPM URL block) intercept -- and because it ran silently, the network activity
and the resulting failure were invisible.

Make the devcontainer CLI detect-only, consistent with how devpod and gh are
already handled: report whether it is present and, if not, print the install
URL (plus a 'brew install devcontainer' alternative that avoids the npm
registry). Nothing is downloaded on the user's behalf.

install.ps1 needs no change -- it only detects devcontainer in WSL and
delegates the binary install to install.sh, so the silent fetch is gone from
the Windows/WSL path too.

Copilot-Session: 1061ab5c-0b78-4baa-87e2-2ba93359413f
@aniongithub
aniongithub merged commit 4075a4e into main Aug 2, 2026
1 check passed
@aniongithub
aniongithub deleted the aniongithub-fix-npm-silent-install branch August 2, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant