0

I am doing some setup whcih required me to uninstall earlier node and npm setup, and install again using brew. But when i uninstalled it, and then installed it using brew install node, it gives me an error "bash: /usr/bin/npm: No such file or directory"

I uninstalled them once again, and when I type node (to see which path it is called in) I get, "bash: /home/username/.linuxbrew/bin/node: No such file or directory"

Whereas if I type npm I get, "bash: /usr/bin/npm: No such file or directory"

I think maybe the reason of error is this discrepancy in both the paths. Any suggestions on how to install it correctly using brew?

bfontaine
  • 18,169
  • 13
  • 73
  • 107
Avnish Gaur
  • 489
  • 1
  • 4
  • 16

1 Answers1

2

You made the same mistake I did. There are bad instructions on the internet for how to install node which come up on top on Google. They say install npm separately. Wrong. npm is included with nodejs (It's not called "node" either. Nodejs will tell you that the name "node" is a different program by a different author.)

Follow these instructions:

https://nodejs.org/en/download/package-manager/

Walker Rowe
  • 953
  • 1
  • 12
  • 24