Skip to content

Instantly share code, notes, and snippets.

@arnaudcourtecuisse
Last active June 1, 2018 10:21
Show Gist options
  • Save arnaudcourtecuisse/1e2b8a50b95ad2d19ebe49aa20bc4ed0 to your computer and use it in GitHub Desktop.
Save arnaudcourtecuisse/1e2b8a50b95ad2d19ebe49aa20bc4ed0 to your computer and use it in GitHub Desktop.
Add this in your .bashrc to have your local node_modules/.bin in your path
PROMPT_COMMAND=__prompt_command
__prompt_command() {
# Remove previous existing .bin in $PATH
PATH=$(echo $PATH | sed -e "s@[^:]\+node_modules/.bin@@ ; s/\(^:\|:$\)// ; s/::/:/")
# Add current .bin and export
export PATH=$(npm bin):$PATH
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment