Skip to content

Install script configures .zshrc incorrectly on MacOS when using Homebrew #1237

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

Open
esseb opened this issue Aug 26, 2024 · 2 comments
Open

Comments

@esseb
Copy link

esseb commented Aug 26, 2024

Using macOS 14.6.1 (23G93) on a MacBook Pro 16-inch, 2021 with an Apple M1 Pro chip.

Steps to reproduce

  1. Install using curl -fsSL https://fnm.vercel.app/install | bash
  2. Run source /Users/esseb/.zshrc as instructed
  3. Run fnm use

Expected result

fnm should run without any errors.

Actual result

error: We can't find the necessary environment variables to replace the Node version.
You should setup your shell profile to evaluate `fnm env`, see https://github.com/Schniz/fnm#shell-setup on how to do this
Check out our documentation for more information: https://fnm.vercel.app

Further information

I think the bug is because setup_shell in https://fnm.vercel.app/install appends this to .zshrc:

# fnm
FNM_PATH="/Users/esseb/Library/Application Support/fnm"
if [ -d "$FNM_PATH" ]; then
  export PATH="/Users/esseb/Library/Application Support/fnm:$PATH"
  eval "`fnm env`"
fi

The folder that FNM_PATH refers to is never created in download_fnm when using homebrew, however, so the if statement is not true and fnm env does not get run.

@esseb
Copy link
Author

esseb commented Aug 26, 2024

#824 (comment) seems to have discovered the same issue with the incorrect FNM_PATH.

@TrevorBurnham
Copy link

Same issue here. Fresh install under zsh on macOS 15.1.1.

Can confirm that fix you linked to (changing the path in ~/.zshrc) works. 👍🏻

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

No branches or pull requests

2 participants