Skip to content

Instantly share code, notes, and snippets.

@usefulthink
Created May 30, 2017 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usefulthink/54258bee49472b175e7c7c37cbaa5ad1 to your computer and use it in GitHub Desktop.
Save usefulthink/54258bee49472b175e7c7c37cbaa5ad1 to your computer and use it in GitHub Desktop.
# add this to your .bashrc to add `npm bin` dynamically to your path (works with bash > 4):
function command_not_found_handle() {
npmBinDir=`npm bin`
if [ -x "$npmBinDir/$1" ] ; then
"$npmBinDir/"$@
else
echo "$1: command not found" >&2
( exit 127 )
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment