3 ms·
Can I still just install NVM and use that to install and maintain Node? I assume snap will suffer the same annoyances of apt where I can't trivially get the exa
by Waterluvian 7y ago
Can I still just install NVM and use that to install and maintain Node? I assume snap will suffer the same annoyances of apt where I can't trivially get the exact version I want and switch among them.
- thedevelopnik 7y agoYes. That’s what I did. I’m an ops engineer supporting multiple dev teams who are on varying versions of Node, nvm is all I can use.
- wayneftw 7y agoIf you don’t like NVM’s shell config shenanigans you can use n - https://github.com/tj/n https://github.com/tj/n
- nicoburns 7y agoThere'a also `nodenv` which I've taken to using recently. Doesn't slow down opening new shells like nvm. And has a handy feature that will set the used node version to whatever is found in a directory's `.node-version` file.
- capableweb 7y agoYou can also just wrap the nvm commands in a function. I have it named `n`, so before doing any node/npm stuff in a shell, I run `n` then `node ....` whatever I wanted. Simple and doesn't slow down opening new shells. function n() { export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" } Found it to be a ok workaround for the issue. Otherwise I'm just on nvm just because it continues to work and hasn't gotten in my way, since like 2013 or something. If someone is in the same boat but wanna fix the "slow new shell" thing, this is a quick fix for it. Would love to hear what the "shell config shenanigans" wayneftw talked about, haven't hit that myself.
- bow_ 7y agoAnd `pyenv` [1], for Python. I came into `nodenv` after being a regular user of `pyenv` for a while. Started with `nvm`, but wished for something more pyenv-like. There is also `asdf` [2], which seems even more generic. On paper it looks interesting, but I haven't found a solid reason to switch out of `pyenv` and `nodenv`. Has anyone tried `pyenv` and/or `nodenv` and switched to `asdf`? [1] https://github.com/pyenv/pyenv https://github.com/pyenv/pyenv [2] https://github.com/asdf-vm/asdf https://github.com/asdf-vm/asdf