Skip to content
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

Brew Node conflict #1341

Closed
thoroc opened this issue Dec 4, 2024 · 3 comments
Closed

Brew Node conflict #1341

thoroc opened this issue Dec 4, 2024 · 3 comments

Comments

@thoroc
Copy link

thoroc commented Dec 4, 2024

I have noticed that a recently installed tool had a newer version of Node installed and that version (v23.3.0) was being used in my current work project instead of the one set by fnm. I have attempted to remove both (installed through homebrew) and reinstall from fresh, taking care to remove the dirs ~/.local/share/fnm and ~/.local/state/fnm_multishells/.

However I cannot get fnm use 20.10 after having installed it through fnm. Instead I get this error message:

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
node --version
v23.3.0
fnm --version
fnm 1.38.1
fnm ls
* v20.10.0 default
* v22.12.0
* system
which node
/opt/homebrew/opt/npm/bin/node
fnm env
export PATH="/Users/thoroc/.local/state/fnm_multishells/75024_1733313406220/bin":$PATH
export FNM_MULTISHELL_PATH="/Users/thoroc/.local/state/fnm_multishells/75024_1733313406220"
export FNM_VERSION_FILE_STRATEGY="local"
export FNM_DIR="/Users/thoroc/.local/share/fnm"
export FNM_LOGLEVEL="info"
export FNM_NODE_DIST_MIRROR="https://nodejs.org/dist"
export FNM_COREPACK_ENABLED="false"
export FNM_RESOLVE_ENGINES="true"
export FNM_ARCH="arm64"
rehash
@thoroc
Copy link
Author

thoroc commented Dec 4, 2024

Followed the instruction on #824 (comment) to add the env via .zshrc. That seems to have fixed the auto change on cd, and I make use of the fnm use <version>:

fnm use 22.10.0
Using Node v22.10.0

However node is still the system one.

@thoroc
Copy link
Author

thoroc commented Dec 4, 2024

Uninstalled node through homebrew: brew uninstall node and it is now happy, but now no system version of node is installed on the machine.

@thoroc
Copy link
Author

thoroc commented Dec 4, 2024

fnm ls
* v20.10.0 default
* v20.18.1 Iron
* v22.10.0
* v22.12.0 Jod
* system
fnm use system
Bypassing fnm: using system node
node --version
zsh: command not found: node
fnm use 
Using Node v22.10.0
node --version
v22.10.0
which node
/Users/<user>/.local/state/fnm_multishells/80576_1733316727129/bin/node

@thoroc thoroc closed this as completed Dec 4, 2024
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

1 participant