From 4dcbd4a7cf6572cd537e5b35739c99420bda02bd Mon Sep 17 00:00:00 2001 From: rxliuli Date: Sat, 28 Nov 2026 18:47:27 +0700 Subject: [PATCH 1/3] fix(downloads): fix macOS fnm, Homebrew, and 0install snippets --- apps/site/snippets/en/download/brew.bash | 11 +++++++++-- apps/site/snippets/en/download/fnm.bash | 8 ++++++-- apps/site/snippets/en/download/zeroinstall.bash | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/apps/site/snippets/en/download/brew.bash b/apps/site/snippets/en/download/brew.bash index 96c16ac6bd083..96189e5ad4cc8 100644 --- a/apps/site/snippets/en/download/brew.bash +++ b/apps/site/snippets/en/download/brew.bash @@ -1,5 +1,12 @@ -# Download and install Homebrew -curl -o- https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash +# Download and install Homebrew: +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + +# In lieu of restarting the shell: +${props.os === 'MAC' ? + 'if [ -x /opt/homebrew/bin/brew ]; then eval "$(/opt/homebrew/bin/brew shellenv)"; fi' : + 'if [ -x /home/linuxbrew/.linuxbrew/bin/brew ]; then eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"; fi' +} # Download and install Node.js: brew install node@${props.release.major} +export PATH="$(brew --prefix node@${props.release.major})/bin:$PATH" diff --git a/apps/site/snippets/en/download/fnm.bash b/apps/site/snippets/en/download/fnm.bash index ab27a1ad68cf0..f60be19d68a54 100644 --- a/apps/site/snippets/en/download/fnm.bash +++ b/apps/site/snippets/en/download/fnm.bash @@ -1,13 +1,17 @@ # Download and install fnm: ${props.os === 'WIN' ? 'winget install Schniz.fnm' : - 'curl -o- https://fnm.vercel.app/install | bash' + props.os === 'MAC' ? + 'curl -o- https://fnm.vercel.app/install | bash -s -- --force-no-brew' : + 'curl -o- https://fnm.vercel.app/install | bash' } # In lieu of restarting the shell ${props.os === 'WIN' ? 'fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression' : - 'export PATH="$HOME/.local/share/fnm:$PATH"\neval "$(fnm env)"' + props.os === 'MAC' ? + 'export PATH="$HOME/Library/Application Support/fnm:$PATH"\neval "$(fnm env)"' : + 'export PATH="$HOME/.local/share/fnm:$PATH"\neval "$(fnm env)"' } # Download and install Node.js: diff --git a/apps/site/snippets/en/download/zeroinstall.bash b/apps/site/snippets/en/download/zeroinstall.bash index a8e51a5044156..63b794c5fdeb7 100644 --- a/apps/site/snippets/en/download/zeroinstall.bash +++ b/apps/site/snippets/en/download/zeroinstall.bash @@ -1,5 +1,5 @@ # Get 0install: -${props.os === 'WIN' ? 'winget install 0install' : 'curl -O https://get.0install.net/0install.sh && chmod +x 0install.sh\n./0install.sh\nexport PATH=$HOME/bin:$PATH'} +${props.os === 'WIN' ? 'winget install 0install' : 'curl -O https://get.0install.net/0install.sh && chmod +x 0install.sh\n./0install.sh install home\nexport PATH=$HOME/bin:$PATH'} # Add Node.js and npm to PATH: 0install add node https://apps.0install.net/javascript/node.xml --version=${props.release.version} From c76da44fd865c72925d4175ad657b36bb197d2f1 Mon Sep 17 00:00:00 2001 From: rxliuli Date: Sat, 28 Nov 2026 22:21:52 +0700 Subject: [PATCH 2/3] fix(downloads): export N_PREFIX and PATH in n snippet --- apps/site/snippets/en/download/n.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/site/snippets/en/download/n.bash b/apps/site/snippets/en/download/n.bash index 6de7abe3d79bb..42bdbbca88595 100644 --- a/apps/site/snippets/en/download/n.bash +++ b/apps/site/snippets/en/download/n.bash @@ -1,5 +1,9 @@ # Download and install n and Node.js: curl -fsSL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s ${props.release.major} +# In lieu of restarting the shell: +export N_PREFIX="$HOME/n" +export PATH="$N_PREFIX/bin:$PATH" + # Node.js already installs during n-install, but you can also install it manually: # n install ${props.release.major} From 4cd44d254a00ef7146e7206988c9bf9b9209797b Mon Sep 17 00:00:00 2001 From: rxliuli Date: Sat, 28 Nov 2026 22:30:53 +0700 Subject: [PATCH 3/3] fix(downloads): persist Homebrew and keg-only Node PATH in shell profiles --- apps/site/snippets/en/download/brew.bash | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/site/snippets/en/download/brew.bash b/apps/site/snippets/en/download/brew.bash index 96189e5ad4cc8..3b2c5193f5b82 100644 --- a/apps/site/snippets/en/download/brew.bash +++ b/apps/site/snippets/en/download/brew.bash @@ -1,12 +1,21 @@ # Download and install Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -# In lieu of restarting the shell: +# Add Homebrew to your PATH: ${props.os === 'MAC' ? - 'if [ -x /opt/homebrew/bin/brew ]; then eval "$(/opt/homebrew/bin/brew shellenv)"; fi' : - 'if [ -x /home/linuxbrew/.linuxbrew/bin/brew ]; then eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"; fi' + `if [ -x /opt/homebrew/bin/brew ]; then + eval "$(/opt/homebrew/bin/brew shellenv)" + grep -qs '/opt/homebrew/bin/brew shellenv' ~/.zprofile ~/.zshrc || { echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"'; } >> ~/.zprofile +fi` : + `if [ -x /home/linuxbrew/.linuxbrew/bin/brew ]; then + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + grep -qs '/home/linuxbrew/.linuxbrew/bin/brew shellenv' ~/.bashrc ~/.profile || { echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"'; } >> ~/.bashrc +fi` } # Download and install Node.js: brew install node@${props.release.major} + +# Add Node.js to your PATH (required for keg-only LTS formulas): export PATH="$(brew --prefix node@${props.release.major})/bin:$PATH" +grep -qs "$(brew --prefix node@${props.release.major})/bin" ${props.os === 'MAC' ? '~/.zshrc' : '~/.bashrc'} || { echo; echo 'export PATH="'"$(brew --prefix node@${props.release.major})/bin"':$PATH"'; } >> ${props.os === 'MAC' ? '~/.zshrc' : '~/.bashrc'}