DEV Community

Discussion on: Building a VSCode Extension: Part Two

 
michaelcurrin profile image
Michael Currin

Also you can lock an apt package version. Today I learned!

askubuntu.com/questions/18654/how-...

Thread Thread
 
codebycorey profile image
Corey O'Donnell • Edited

I never really noticed that load time for NVM. The half a second it would take on my machine didn't bother me but I decided to look into it.

When you source nvm, you can add --no-use to it.
no-use documentation
This will then prevent nvm from sourcing node until you run nvm use.
This should pretty much source the nvm script instantly now.

Thread Thread
 
michaelcurrin profile image
Michael Currin

Thanks for sharing.

Works for me.

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --no-use
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"