Problems installing Node and NPM via Homebrew
Solution 1:
I just solved this same error. What worked for me was:
brew install node
sudo chmod 776 /usr/local/lib
brew link --overwrite node
sudo chmod 755 /usr/local/lib
When I ran npm -v
I got the same error:
internal/modules/cjs/loader.js:983
throw err;
To solve it I ran brew reinstall node
and everything is running as expected now.