brew install npm "npm: command not found"

I encountered the same issue. After searching and reading different things online, what worked for me was:

$ brew postinstall node

However, first please do execute:

$ brew doctor

and follow the instructions there first, like the comment in your question mentions.


Try running

$ brew postinstall node

If you ever ran sudo npm / sudo yarn, then you might need to change the owner of your global node_modules folder:

$ sudo chown -R "$(id -un)" "${NODE_PATH:-/usr/local/lib/node_modules}"