Created
February 5, 2025 06:54
-
-
Save ubuntupunk/13ce81a95cb2822b5df9f94891cb2fac to your computer and use it in GitHub Desktop.
lazynvm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazynvm() { | |
unset -f nvm node npm | |
export NVM_DIR=~/.nvm | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
} | |
nvm() { | |
lazynvm | |
nvm $@ | |
} | |
node() { | |
lazynvm | |
node $@ | |
} | |
npm() { | |
lazynvm | |
npm $@ | |
} | |
npx() { | |
lazynvm | |
npx $@ | |
} | |
see: https://broken-by.me/lazy-load-nvm/ | |
see: https://stackoverflow.com/questions/47009776/how-to-run-nvm-in-oh-my-zsh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment