Last active
August 14, 2018 16:46
-
-
Save libertylocked/7f606b59ca36eb5b92c961018d86db61 to your computer and use it in GitHub Desktop.
npm-nvm.sh - run npm using a node version specified in nvmrc.
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
#!/bin/sh | |
# This script runs NPM using a version of node specified in nvmrc | |
# npm-nvm.sh <command> | |
# Examples: | |
# - npm-nvm.sh install | |
# - npm-nvm.sh run build | |
NPM_PREFIX=$(npm config get prefix) | |
npm config delete prefix | |
source /usr/share/nvm/init-nvm.sh --install && \ | |
nvm install && \ | |
nvm use --delete-prefix && \ | |
npm $@ && \ | |
nvm unalias default | |
npm config set prefix ${NPM_PREFIX} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment