user3142695
user3142695

Reputation: 17322

What would be the way now to install node with npm via brew

I've installed node on my macOS

brew install node

After doing this, node is installed correctly:

$ node -v
  v8.4.0

But running

$ npm -v

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

What would be the way now to install node with npm via brew?

brew install node uses by default --without-npm

Upvotes: 6

Views: 1471

Answers (3)

clay
clay

Reputation: 6017

Don't use Homebrew to install node.

I like the Node Version Manager (NVM), and there is n. These are better options on a Mac for node, to avoid certain. issues. later. Plus it avoids this question, as these node versions include npm.

Note, you can install nvm and n via Homebrew. (brew install nvm or brew install n).

Upvotes: 0

Andrea Carraro
Andrea Carraro

Reputation: 10419

I stepped into a similar issue, too. My problem was that I still had not a ~/.bash_profile file in place and therefore no place where to actually link my bash command to npm.

Upvotes: 1

XtalOsc
XtalOsc

Reputation: 71

I had the same problem. I ran $ brew doctor to make sure node was linked first. Then I ran
$ brew postinstall node

$ npm -v should now show the version number.

Upvotes: 2

Related Questions