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
None of the other answered solved my issue. After reinstalling Node, I still got the same error (even when I just wrote npm -v).
npm -v
I followed this answer here (removing everything called node and npm), which solved it for me.