-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fresh install on macOS using Homebrew: shell looking in wrong INSTALL_DIR #1194
Comments
Looking at the recent changes to the installer, it appears that this may have have been introduced in #937. A simple fix might be to re-set |
I can confirm this does happen on the current homebrew version 1.37.1. This is especially bad because if you follow the official guide from nodejs website, you'll end up with a borked installation: # installs fnm (Fast Node Manager)
curl -fsSL https://fnm.vercel.app/install | bash
# download and install Node.js
fnm use --install-if-missing 20 The second command will install node in a wrong (default) directory, while your .zshrc will be setting the wrong path: FNM_PATH="/Users/username/Library/Application Support/fnm"
if [ -d "$FNM_PATH" ]; then
# ...
# will not happen as the directory does not exist |
I have the same situation and getting error like
Thank you |
faced this as well quick workaround fix is this one cd ~
brew uninstall fnm
mkdir .fnm
curl -fsSL https://fnm.vercel.app/install | bash now it says (i use fish shell): Installing for Fish. Appending the following to /Users/colch/.config/fish/conf.d/fnm.fish:
# fnm
set FNM_PATH "/Users/colch/.fnm"
if [ -d "$FNM_PATH" ]
set PATH "$FNM_PATH" $PATH
fnm env | source
end added that into config, and it works :) good luck! got this by reading source code for install script: Lines 12 to 13 in 119ffc5
|
So ~/.fnm is not the fallback directory for the fnm binary. This actually works for some reason, even though ~/.fnm is empty. Fallback directory is actually cd ~
brew uninstall fnm
mkdir -p ~/.local/share
export XDG_DATA_HOME=$HOME/.local/share
curl -fsSL https://fnm.vercel.app/install | bash |
I apologize if I'm missing something obvious.
I just tried installing fnm on a fresh MacBook (running macOS Sonoma 14.5) using the default recommended installation script (
curl -fsSL https://fnm.vercel.app/install | bash
). I can see that this uses Homebrew to do the installation. The output looks pretty expected:The problem is, the
/Users/cranfill/Library/Application Support/fnm
directory is not created, so the shell integration code does nothing.which fnm
returns the default Homebrew location:cranfill@MT-407147 ~ % which fnm /opt/homebrew/bin/fnm
Reviewing the code in the install script, I don't see any situation in which the correct installation directory for a Homebrew install gets used in the shell setup code.
The text was updated successfully, but these errors were encountered: