Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

NPM Won't Run After Upgrade

NPM Won't Run After Upgrade

Problem

I've been using node .4x and npm, and decided to Upgrade to .67. Oh boy.

I'm on Mac OSX--new to it.

When I type npm I get

-bash: /usr/bin/npm: No such file or directory

echo $PATH shows a lot of stuff...some redundancies.

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/Users/me/.rvm/bin:/usr/local/bin:/usr/local/:/usr/local/bin:/usr/local/bin/npm:/usr/local/bin/:/usr/local:/usr/local/bin:/usr/local/

I've tried a number of different installations, and likely should clean it up, which I don't know how to do :)

Any insights?

Problem courtesy of: bear

Solution

If npm is no longer installed in /usr/bin/npm, then chances are good bash(1) has hashed the executable name. The hashing saves repeated searches of all directories in your PATH every time you execute common programs. Since programs almost never change directories, this is usually a great idea.

To test, run hash -r. This will cause bash(1) to forget all its mappings. (This is harmless -- it starts up with no mappings and grows them over time.) If I was right, your npm will execute the correct executable wherever it lives.

Solution courtesy of: sarnold

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

NPM Won't Run After Upgrade

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×