Skip to content

fix: handle missing corepack in setup.sh with npm fallback#9202

Open
valkrypton wants to merge 1 commit into
makeplane:previewfrom
valkrypton:fix/setup-corepack-fallback
Open

fix: handle missing corepack in setup.sh with npm fallback#9202
valkrypton wants to merge 1 commit into
makeplane:previewfrom
valkrypton:fix/setup-corepack-fallback

Conversation

@valkrypton
Copy link
Copy Markdown

@valkrypton valkrypton commented Jun 3, 2026

Falls back to npm install -g corepack, then npm install -g pnpm if corepack is unavailable. Adds guard before pnpm install to avoid silent exit 127.

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • Chores
    • Improved setup experience: the installer now verifies the package manager is available, provides clear guidance and exits if it's missing, and more reliably reports failures during dependency installation to avoid partial or confusing setups.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c59c23b2-202e-4900-854e-8fed44f15b4b

📥 Commits

Reviewing files that changed from the base of the PR and between daf2c19 and dce8679.

📒 Files selected for processing (1)
  • setup.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • setup.sh

📝 Walkthrough

Walkthrough

The setup.sh script now checks for the presence of corepack before enabling pnpm; if corepack is missing it prints Node.js/corepack installation guidance and exits. If corepack is present it runs corepack enable pnpm || success=false and then pnpm install (marking failures).

Changes

Setup Script Improvements

Layer / File(s) Summary
Corepack presence check and pnpm enable
setup.sh
Replaces unconditional corepack enable pnpm with a guarded availability check: exits with an error if corepack is not installed; otherwise runs `corepack enable pnpm

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped to the script and gave it a peep,
Checked for corepack before digging too deep,
If it's missing, I thump and I cry,
"Install Node/corepack" — then we'll try! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description identifies the bug fix type and mentions the two main changes (fallback to npm install and guard before pnpm install), but is incomplete relative to the template. Complete the description by adding test scenarios section and more detailed explanation of what issue this fixes and how the fallback mechanism works.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title mentions handling missing corepack and fallback, which aligns with the main change of adding corepack availability checks and fallback logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@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 `@setup.sh`:
- Around line 84-89: The npm-based fallback in the elif branch (the lines that
call `npm install -g corepack`, `npm install -g pnpm`, and the fallback block)
violates the package-manager policy; remove the npm-based installation logic and
instead attempt only `corepack enable pnpm` when corepack is present, and if
corepack is not available or enabling fails, print a clear remediation error
(e.g., instructing the user to install Corepack or pnpm manually) and exit
non‑zero (set success=false or call exit 1). Update the branch that currently
runs when `command -v npm` would match so it only reports the missing
Corepack/PNPM path and fails, referencing the existing conditional block that
echoes "${YELLOW}corepack not found — installing pnpm via npm...${NC}" to
replace that behavior with the policy-compliant failure message.
🪄 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

Run ID: d76f3f40-59b0-4d7d-a1eb-67af568fa0df

📥 Commits

Reviewing files that changed from the base of the PR and between b6e47cc and daf2c19.

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

Comment thread setup.sh Outdated
Replaces npm fallback with an explicit error directing users to install
Node.js 16.9+, keeping setup.sh pnpm/corepack-only per repo policy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@valkrypton valkrypton force-pushed the fix/setup-corepack-fallback branch from daf2c19 to dce8679 Compare June 3, 2026 12:47
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