Skip to content

macOS download snippets: 6 of 7 options fail on a clean macOS machine (and all emit zsh '#' errors) #9350

Not planned

Description

@rxliuli

URL:

https://nodejs.org/en/download

Browser Name:

Safari (snippets copied into macOS default Terminal.app running /bin/zsh)

Browser Version:

Safari 27.2

Operating System:

macOS 27.2.1 (26B131), Apple Silicon (arm64) — fresh VM with default /bin/zsh, no ~/.zshrc, no Xcode Command Line Tools, and no Homebrew

How to reproduce the issue:

On a brand-new macOS machine (or clean macOS VM), open https://nodejs.org/en/download, select macOS, and test every single one of the 7 shell install options by clicking the snippet's Copy button and pasting it into the default macOS Terminal (/bin/zsh).

Summary of results (6 out of 7 fail on a clean Mac)

# Option Snippet file Result on clean macOS Root cause
1 nvm (default) apps/site/snippets/*/download/nvm.bash ❌ Fails nvm's installer requires git, which triggers the macOS Xcode CLT stub and aborts (You may be on a Mac, and need to install the Xcode Command Line Developer Tools). No prerequisite is mentioned on the page.
2 fnm apps/site/snippets/*/download/fnm.bash ❌ Fails fnm's install script detects curl (OK!) and unzip (OK!), but defaults to USE_HOMEBREW="true" on macOS unless --force-no-brew is passed, so it aborts with Checking availability of Homebrew (brew)... Missing!.
3 Homebrew apps/site/snippets/*/download/brew.bash ❌ Fails (broken command) The snippet pipes the installer via curl -o- https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash, which consumes stdin. Homebrew immediately aborts with Warning: Running in non-interactive mode because 'stdin' is not a TTY. → Insufficient permissions to install Homebrew to "/opt/homebrew". Homebrew's official command is /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" specifically to keep stdin attached to the TTY for sudo.
4 n apps/site/snippets/*/download/n.bash ❌ Fails Aborts immediately with n-install: ERROR: GNU Make not found, which is required for operation. (no prerequisite mentioned).
5 0install apps/site/snippets/*/download/zeroinstall.bash ❌ Fails (broken command) Runs ./0install.sh without arguments, which only prints usage help (To install to your home directory: ./0install.sh install home) without installing 0install, so all subsequent 0install add ... commands fail.
6 asdf apps/site/snippets/*/download/asdf.bash ❌ Fails Does not install asdf first (only comments pointing to external docs), so pasting the snippet fails with zsh: command not found: asdf.
7 Vite+ apps/site/snippets/*/download/vp.bash ✅ Succeeds (with zsh # errors) The only option that actually installed Node.js (v26.13.1) and npm (11.20.0) on a clean Mac without prior developer tooling, though pasting still emitted 4 zsh: command not found: # lines.

Cross-cutting bug affecting all 7 snippets on macOS: # comments fail in default zsh

Since macOS Catalina (2019), the default shell on macOS is zsh, where INTERACTIVE_COMMENTS is disabled by default. Copying any multi-line snippet from the download page and pasting it into Terminal.app prints zsh: command not found: # for every comment line (and treats inline # Should print "..." comments as literal CLI arguments).

Observed terminal outputs on clean macOS 27.2.1 (arm64)

1. nvm

zsh: command not found: #
You may be on a Mac, and need to install the Xcode Command Line Developer Tools.
If so, run `xcode-select --install` and try again. If not, please report this!
zsh: command not found: #
.: no such file or directory: /Users/ruri/.nvm/nvm.sh
zsh: command not found: #
zsh: command not found: nvm
zsh: command not found: #
zsh: command not found: node
zsh: command not found: #
zsh: command not found: npm

2. fnm

zsh: command not found: #
Downloading fnm using Homebrew...
Checking dependencies for the installation script...
Checking availability of curl... OK!
Checking availability of unzip... OK!
Checking availability of Homebrew (brew)... Missing!
Not installing fnm due to missing dependencies.
zsh: command not found: #
zsh: command not found: fnm

3. Homebrew

zsh: command not found: #
Warning: Running in non-interactive mode because `stdin` is not a TTY.
==> Checking for `sudo` access...
Insufficient permissions to install Homebrew to "/opt/homebrew".
zsh: command not found: #
zsh: command not found: brew

4. n

zsh: command not found: #
n-install: ERROR:
  GNU Make not found, which is required for operation.
  On FreeBSD and PC-BSD, for instance, you can download it with `sudo pkg install gmake`.

5. 0install

zsh: command not found: #
This script runs 0install from your PATH or downloads it on-demand.

To run 0install commands without adding 0install to your PATH:
./0install.sh --help
./0install.sh COMMAND [OPTIONS]

To install to /usr/local:
sudo ./0install.sh install local

To install to your home directory:
./0install.sh install home

6. asdf

zsh: command not found: #
zsh: command not found: asdf

7. Vite+

✓ Vite+ setup complete.
zsh: command not found: #
zsh: command not found: #
VITE+ - The Unified Toolchain for the Web
✓ Default Node.js version set to 26.13.1
zsh: command not found: #
v26.13.1
zsh: command not found: #
11.20.0

Suggested fixes

  1. Strip # comments when copying (or omit comments from copyable code blocks) so pasting into macOS's default interactive zsh doesn't emit zsh: command not found: #.
  2. Fix brew.bash: use Homebrew's official interactive invocation (/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)") instead of piping to bash, and note that Homebrew requires eval "$(/opt/homebrew/bin/brew shellenv)" on Apple Silicon before brew install works in the same shell.
  3. Fix fnm.bash on macOS: pass --force-no-brew (curl -fsSL https://fnm.vercel.app/install | bash -s -- --force-no-brew) so fnm installs directly via curl + unzip without requiring Homebrew.
  4. Fix zeroinstall.bash: change ./0install.sh to ./0install.sh install home so 0install is actually installed into $HOME/bin.
  5. Document prerequisites clearly (or reconsider the default macOS option): explicitly note that nvm and n require Xcode Command Line Tools (git / make) on macOS — or promote an option that works out of the box on a clean Mac (such as the official .pkg installer, fixed fnm --force-no-brew, or vp).

Activity

  1. rxliuli commented on Nov 28, 2026

    @rxliuli
    Author
    1-nvm 2-fnm 3-homebrew 4-n 5-0install 6-asdf 7-vite-plus
  2. rxliuli commented on Nov 28, 2026

    @rxliuli
    Author

    Follow-up findings from deeper end-to-end re-testing across a clean macOS 27.2.1 (arm64) VM, post-Xcode-CLT macOS (with no ~/.zshrc), and ubuntu:24.04 Linux containers (aarch64 and amd64):

    1. 0install has no native ARM64 standalone binary on macOS or Linux

      • On Apple Silicon macOS without Rosetta 2, fixing ./0install.sh -> ./0install.sh install home reveals a second failure: https://get.0install.net/0install-darwin-arm64-latest.tar.bz2 performs two 302 redirects to a September 2020 Intel build (0install-darwin-arm64-2.16.tar.bz2 → 0install-darwin-x86_64-2.16.tar.bz2). Running ./0install.sh install home prints ./0install: Bad CPU type in executable (and its extracted install.sh lacks set -e, so it still prints OK and installs the x86_64 binary into ~/bin/0install), causing all 0install add ... commands to fail with zsh: bad CPU type in executable: 0install. Upstream https://get.0install.net/ defaults macOS users to brew install zero-install (Homebrew ships native arm64 bottles for v2.18), which is redundant with the existing Homebrew option on nodejs.org.
      • On Linux aarch64, https://get.0install.net/0install-linux-aarch64-latest.tar.bz2 redirects to https://github.com/0install/0install/releases/download/v2.18/0install-linux-aarch64-2.18.tar.bz2 which returns HTTP 404.
      • On Linux x86_64, ./0install.sh install home works end-to-end (0install 2.18, node v26.13.1, npm 11.20.0).
    2. n.bash also fails in the current shell even when make / Xcode CLT is installed (and on Linux)

      • After answering CONTINUE (y/N)? y, n-install updates ~/.bashrc / ~/.zshrc for new shells, but n.bash has no export N_PREFIX="$HOME/n" / export PATH="$N_PREFIX/bin:$PATH" for the current shell.
      • Consequently, the trailing node -v and npm -v commands immediately fail with command not found in the same shell on both Linux (ubuntu:24.04) and macOS (post-Xcode-CLT).
    3. nvm.bash does not persist across new terminals on a clean macOS machine (even after installing Xcode CLT)

      • Fresh macOS accounts do not have ~/.zshrc by default. nvm's install.sh does not create one—it prints => Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zprofile, ~/.zshrc, and ~/.profile. and skips profile setup.
      • As a result, node -v works in the initial shell via \. "$HOME/.nvm/nvm.sh", but nvm, node, and npm are all command not found in any newly opened terminal window.
    4. Opened two split PRs

  3. moved this from 📋 Backlog to ✅ Done in Node.js Websiteon Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions