How to change the path of application in OSX I removed phonegap from  

/usr/local/bin/phonegap  


and installed it again using npm, now when running phonegap, I see this error:  

-bash: /usr/local/bin/phonegap: No such file or directory


while phonegap is installed in  

/Users/myUserName/.nvm/v5.8.0/lib/node_modules


How can I fix this?
I can't speak to the odd path you've installed this software into, but the reason the shell says it can't find it is that bash (and other shells) maintain a hash table with the locations of executable binaries that have been run before.  The reason behind this is so that the shell doesn't have to actually search for it each time it needs to execute it.

See: http://www.gnu.org/software/bash/manual/bash.html#Command-Search-and-Execution

To force bash to re-hash the table, use 'hash -r' .