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

Can't set node version globally #238

Closed
zeitmeister opened this issue Feb 14, 2025 · 1 comment
Closed

Can't set node version globally #238

zeitmeister opened this issue Feb 14, 2025 · 1 comment

Comments

@zeitmeister
Copy link

I'm most likely an idiot who doesnt understand all of this but on a fresh install of Arch running Sway(wayland) and fish. I install this plugin and open nvm which works in every new shell and terminal window i open. i then install LTS node version and i also use it.
In my mind node and npm would be available in a new shell but it's not.
I get fish: Unknown command: npm

In order to get it to work globally was to do in my fish config:

nvm use v22.14.0 lts/jod > /dev/null 2>&1

the extra part was just to get rid of the the version text showing in all new terminal windows. this seems like a hacky way to solve this.
I mean, isn't this exactly what nvm is for so i dont have to bother with these types of configs myself? Am i supposed to have a .npmrc in my home folder or something?
I'm sure there is something im missing.

@jorgebucaran
Copy link
Owner

Use the built-in variable to set a default Node version:

set --universal nvm_default_version lts

This makes nvm.fish automatically use the LTS version in every new shell (if it's installed). No need for hacks in config.fish.

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