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?
If your npm is broken: On Mac or Linux, reinstall npm. Windows: If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer (see this note about installing the latest stable version).
Run npm update -g npm. Execute this command by running the command prompt as Administrator npm install -g windows-build-tools. Run npm install inside the project folder where the package. json file is located, if it doesn't work run: npm install --force.
In Windows, you can simply download the newest version of node and install it. It'll upgrade both node and npm.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With