Skip to content

fix: abort with a clear message on Intel macOS for pnpm v11+#46

Merged
zkochan merged 4 commits intomainfrom
abort-on-intel-macos
May 4, 2026
Merged

fix: abort with a clear message on Intel macOS for pnpm v11+#46
zkochan merged 4 commits intomainfrom
abort-on-intel-macos

Conversation

@zkochan
Copy link
Copy Markdown
Member

@zkochan zkochan commented May 4, 2026

Summary

pnpm-darwin-x64.tar.gz is no longer published from pnpm v11 onward (pnpm/pnpm#11455) because the SEA binary Node.js produces for darwin-x64 segfaults at startup — upstream nodejs/node#62893, which the Node.js team has opted not to fix on the grounds that x64 macOS is being phased out.

Without a guard, install.sh on an Intel Mac asking for v11 will:

  1. Resolve pnpm-darwin-x64.tar.gz from the v11 release.
  2. The download 404s.
  3. The script exits with a generic Install Error! and no explanation.

Change

Add an early abort right after platform/arch/version resolution: if platform=darwin && arch=x64 && major>=11, abort with a clear message and three working alternatives (npm / Homebrew / Corepack), plus a link to pnpm/pnpm#11423 for context.

$ curl -fsSL https://get.pnpm.io/install.sh | sh -
==> Downloading pnpm binaries 11.0.4
pnpm v11.0.4 does not provide a working binary for Intel macOS (darwin-x64) due to an upstream Node.js SEA bug.

Install pnpm a different way instead:
  npm install -g pnpm           # uses your system Node.js
  brew install pnpm             # via Homebrew
  corepack enable pnpm          # bundled with Node.js

More context: https://github.com/pnpm/pnpm/issues/11423

Compat

The guard is gated on all three of: platform=darwin, arch=x64, major>=11. Verified locally:

  • darwin-x64 + v11 → aborts with the message above (exit 1).
  • darwin-x64 + v10 → no abort, install proceeds (v10 @pnpm/exe is still pkg-built and works on Intel Mac).
  • darwin-arm64 + v11 → no abort.
  • linux-x64 + v11 → no abort.

install.ps1 is Windows-only so it doesn't need a corresponding change.

Test plan

  • sh -n install.sh and bash -n install.sh parse cleanly.
  • Functional tests of all four host/version combinations above (positive + negative).
  • On the next pnpm v11+ release, manually confirm the install on an Intel Mac surfaces the message.

Related

Summary by CodeRabbit

  • Bug Fixes

    • Installer now validates the detected runtime major version and fails gracefully on macOS x64 when an unsupported major runtime (v11+) is detected, showing a clear error and alternative install guidance.
  • Chores

    • Updated installer checksum to ensure integrity verification.

pnpm v11+ no longer publishes pnpm-darwin-x64.tar.gz because the SEA
binary Node.js produces for darwin-x64 segfaults at startup (upstream
nodejs/node#62893; pnpm/pnpm#11423; the Node.js team has decided not
to fix it as Intel macOS is being phased out). Without a guard, the
script 404s on the missing tarball and surfaces as a generic
"Install Error!" with no explanation.

Detect platform=darwin + arch=x64 + major>=11 right after version
resolution and abort early with the upstream issue link plus three
working alternatives (npm / Homebrew / Corepack). Linux, Apple Silicon
Mac, Windows, and v10 darwin-x64 (still pkg-built and working) are
unaffected.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

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

Project Deployment Actions Updated (UTC)
get-pnpm-io Ready Ready Preview, Comment May 4, 2026 9:34pm

Request Review

@netlify
Copy link
Copy Markdown

netlify Bot commented May 4, 2026

Deploy Preview for getpnpm ready!

Name Link
🔨 Latest commit 29f28ff
🔍 Latest deploy log https://app.netlify.com/projects/getpnpm/deploys/69f910cd0cd40b0009ca0edb
😎 Deploy Preview https://deploy-preview-46--getpnpm.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6206fba7-1e7e-4f48-aee7-eb951840c459

📥 Commits

Reviewing files that changed from the base of the PR and between 8d2b898 and 29f28ff.

📒 Files selected for processing (2)
  • SHASUMS256.txt
  • SHASUMS256.txt.sig

📝 Walkthrough

Walkthrough

Adds stricter pnpm major-version parsing and an early abort in download_and_install() to prevent installing pnpm v11+ on macOS Intel (darwin/x64), and updates SHASUMS256.txt with the new install.sh checksum.

Changes

macOS Intel Installation Guard

Layer / File(s) Summary
Data Parsing
install.sh
major_version parsed via sed (strips optional leading v, keeps initial digits); script aborts if parsing yields empty/invalid value.
Core Change / Early Abort Guard
install.sh
New conditional: if platform == darwin and arch == x64 and major_version -ge 11, exit with a multi-line message advising alternative install methods.
Branching Adjustment
install.sh
Later v11+ branch now uses the validated major_version check without suppressing parsing errors (2>/dev/null removed).
Release Integrity
SHASUMS256.txt
Replaced SHA-256 checksum for install.sh to match the updated script.

Sequence Diagram(s)

(No sequence diagram applicable.)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 I nibble bytes on macOS shore,
I strip the v and count the core.
If eleven looms on x64 sand,
I stop the script and offer a hand. 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding an abort with a clear message on Intel macOS for pnpm v11+, which is the primary fix implemented in install.sh.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch abort-on-intel-macos

Comment @coderabbitai help to get the list of available commands and usage tips.

zkochan added a commit to pnpm/pnpm.io that referenced this pull request May 4, 2026
…self-explains

Once pnpm/get.pnpm.io#46 lands, install.sh aborts on darwin-x64 with a
clear pointer to the upstream Node.js issue and three working
alternatives. The page no longer needs to repeat the same context — a
one-line "not supported, use npm/Corepack/Homebrew, see #11423" is
enough. Keeps the link to #11423 for users who want the full story.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@install.sh`:
- Around line 157-159: The script fails to handle PNPM_VERSION values with a
leading "v" (e.g. "v11.0.0") before numeric comparison; normalize PNPM_VERSION
into a cleaned variable (strip any leading "v" or non-digit prefixes) before
computing major_version and before the download decision so cut -d. -f1 yields a
numeric major; update the places that set major_version and the download
selection to use the sanitized version variable (e.g., sanitized_version or
normalized_version derived from PNPM_VERSION) so the numeric comparison and
branching work reliably on Intel macOS and elsewhere.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: be0859a5-b956-4b2f-938c-fbe15cb47996

📥 Commits

Reviewing files that changed from the base of the PR and between 38c616e and 4aa8127.

📒 Files selected for processing (1)
  • install.sh

Comment thread install.sh Outdated
CodeRabbit flagged that `cut -d. -f1` on a v-prefixed version (e.g.
PNPM_VERSION=v11.0.0) returns "v11", which fails the numeric `-ge 11`
test silently because of `2>/dev/null` and skips the Intel-macOS guard.

The same bug was on the pre-existing major_version line further down,
which selects the v11+ tarball vs legacy single-binary download path.

Compute major_version once near the top with `sed -E 's/^v//; s/^([0-9]+).*/\1/'`,
abort early if normalization yields nothing, and reuse the value
throughout. Drops the now-unnecessary `2>/dev/null` suppression on the
remaining test (major_version is guaranteed numeric or we already
aborted) and removes the duplicate computation.

Verified: 11.0.4, v11.0.4, 11.0.0-rc.1, v11, 10.33.2, v10.33.2 all
normalize to the correct major; v11.0.4 with darwin-x64 correctly
triggers the abort.
@zkochan zkochan merged commit 87bc637 into main May 4, 2026
81 checks passed
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