Skip to content

Instantly share code, notes, and snippets.

@antoine-pous
Last active November 11, 2023 21:18
Show Gist options
  • Save antoine-pous/a08710cc7fc63d98b130ed4f992e96ae to your computer and use it in GitHub Desktop.
Save antoine-pous/a08710cc7fc63d98b130ed4f992e96ae to your computer and use it in GitHub Desktop.
Alias to work with nvm without cache conflict
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <[email protected]> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return Antoine POUS
# ----------------------------------------------------------------------------
# Copy this content to your ~/.bashrc then run `source ~/.bashrc`
# Usage: nvu <version> [options]
# Example: nvu 6
nvu() {
nvm install v$1 && nvm use v$@ && mkdir -p ~/.cache/node-$1 && npm config set cache ~/.cache/node-$1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment