2 ms·
You 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
by capableweb 7y ago
You 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.