Skip to content

Instantly share code, notes, and snippets.

@peabnuts123
Created December 16, 2018 22:58
Show Gist options
  • Save peabnuts123/55ef58567a7d226c7661c4361dd76088 to your computer and use it in GitHub Desktop.
Save peabnuts123/55ef58567a7d226c7661c4361dd76088 to your computer and use it in GitHub Desktop.
run local version of npm commands instead of globally installed
# Add to your ~/.bash_profile
# Usage: npm-exec (command) [...args]
# Execute a command located in an npm bin directory, without
# having to manually path to it
function npm-exec() {
bin="${1}";
shift
args="$*"
"$(npm bin)/${bin}" ${args};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment