Repository navigation
fix(pi): find node on PATH when launching from Finder - #7
Merged
Merged
Conversation
Co-authored-by: Cursor <[email protected]>
tsingwong
force-pushed
the
fix/pi-gui-node-path
branch
from
November 19, 2026 10:14
fccb010 to
f7b9c7c
Compare
Spawning pi no longer asks the login shell on the UI thread: the check remembers where node is and spawns only read it. A node next to pi skips the lookup. The directory goes after the inherited PATH so it cannot shadow other tools.
Owner
|
Thanks for the PR and for the clear write-up. The bug is real. pi's installer only puts its own I pushed a commit on top of yours (12557e5) that changes three things:
I also replaced the test. The old one passed without the fix whenever node was already on PATH, so the new ones check the PATH order directly. Tested with a pi that has no node beside it and I'll squash-merge this and ship it in 0.2.9. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Opening the app from Finder failed with
env: node: No such file or directoryeven whenpi --versionworked in a terminal. Managedpiis a#!/usr/bin/env nodescript; GUI launches do not inherit mise/nvm/fnm PATH entries, andpi-nodemay be absent.What changed
path_with_executable_dirnow also prepends the directory ofnodefound the same way aspi(PATH, then login shell), so childpiprocesses get a usable Node.Scope
src/pi.rsonly. Callers (check_installation,spawn_pi, updates, plugins) pick up the richer PATH with no API change.Tradeoffs
Rejected installing or requiring
pi-node. Login-shell lookup fornodematches the existingpidiscovery path and covers mise/nvm/fnm.Blast Radius
First launch / version check may spend a login-shell lookup for
nodewhen it is not on the inherited PATH. Same cost class as discoveringpi.Verification
env: node: No such file or directory1.5.2cargo test pi::→ 3 passedMade with Cursor