feat(install): fix setup_shell function for brew users
Fixing the install script for brew users
Issue
When installing fnm via Homebrew, the binary gets installed to Homebrew's directory structure rather than the default INSTALL_DIR. Additionally, Homebrew automatically adds fnm to the PATH, making our manual PATH manipulation unnecessary and potentially problematic.
Changes
- Set a
USE_HOMEBREWflag to false by default - Updated shell configuration for all supported shells (zsh, fish, bash) to handle Homebrew installations differently:
- For Homebrew installations: only add
eval "$(fnm env)"to shell config files - For direct installations: maintain existing behavior with
PATHmanipulation
- For Homebrew installations: only add
- Simplify shell configuration when Homebrew is used, avoiding redundant
PATHmodifications
These changes ensure fnm works correctly regardless of installation method, while respecting the environment setup performed by package managers.
Fix #824 #1190 #1194 #1237 #1279 #1376
⚠️ No Changeset found
Latest commit: 2e5d41180dcaa898b6d9eca7ddbaaab557d3bcf9
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| fnm | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 28, 2025 6:52am |
👋 @Schniz looks like this PR and https://github.com/Schniz/fnm/pull/1362 both attempt to fix this issue, do you think one of them could be merged soon? Fresh installs following the instructions at https://nodejs.org/en/download still seem to fail on MacOS due to these bugs.