I just came back to work on a React project after working in the Rails environment and found that I cannot run any NPM commands in my Mac terminal. I\'ve tried all the remedies
I had the same error after brew upgradeon mac. I did brew postinstall node and that fixed it.
brew upgrade
brew postinstall node