Skip to content

fix(downloads): fix macOS fnm, Homebrew, and 0install snippets - #9351

Open
rxliuli wants to merge 1 commit into
nodejs:mainfrom
rxliuli:fix/macos-download-snippets
Open

rxliuli wants to merge 1 commit into
nodejs:mainfrom
rxliuli:fix/macos-download-snippets

Conversation

@rxliuli

@rxliuli rxliuli commented Nov 28, 2026

Copy link
Copy Markdown

Description

Fixes three broken download snippets on macOS discovered while testing all 7 shell install options on a clean macOS VM (see #9350):

  1. fnm.bash
    • On macOS, fnm's install script defaults to USE_HOMEBREW="true" and aborts when Homebrew isn't installed, even though macOS already has curl and unzip. Pass -s -- --force-no-brew on macOS so fnm installs its native macOS binary directly.
    • On macOS, fnm's installer places the binary in $HOME/Library/Application Support/fnm rather than Linux's $HOME/.local/share/fnm. Update the macOS PATH export accordingly so eval "$(fnm env)" works immediately in the same shell.
  2. brew.bash
    • Replace curl -o- ... | bash with Homebrew's official interactive invocation (/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)") so stdin stays attached to the TTY and sudo can prompt instead of failing with Insufficient permissions to install Homebrew to "/opt/homebrew".
    • Load brew shellenv on Apple Silicon (/opt/homebrew/bin/brew) and Linuxbrew (/home/linuxbrew/.linuxbrew/bin/brew) so brew install works immediately in the same shell.
    • Prepend $(brew --prefix node@<major>)/bin to PATH so keg-only LTS formulas (e.g. node@24, node@22) are immediately available to the subsequent node -v / npm -v checks.
  3. zeroinstall.bash

Validation

  • Verified rendered output of fnm.bash, brew.bash, and zeroinstall.bash across MAC, LINUX, and WIN using apps/site/util/interpreter.ts.
  • Tested the updated fnm.bash macOS commands end-to-end on a clean macOS 27.2.1 (arm64) VM with no Homebrew and no Xcode Command Line Tools: installs fnm into ~/Library/Application Support/fnm, installs Node v26.13.1 + npm 11.20.0, and persists cleanly in a new zsh session.
  • Verified $(brew --prefix node@26)/bin/node and $(brew --prefix node@24)/bin/node resolve properly for both Current and keg-only LTS Homebrew formulas.
  • Ran pnpm test, pnpm lint, pnpm lint:types, and pnpm prettier — all passed.

Related Issues

Refs #9350

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@rxliuli
rxliuli requested a review from a team as a code owner November 28, 2026 11:51
@vercel

vercel Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nodejs-org Ready Ready Preview Nov 28, 2026 11:52am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 4dcbd4a7 Deployed Nov 28, 2026 by vercel[bot]
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