After $npm install, Getting Error: Cannot find module '../lib/utils/unsupported.js'

  1. Uninstall node brew uninstall --force node
  2. Remove the /usr/local/lib/node_modules folder
  3. Install it again brew install node

Assume this happens on MacOS, below solution works for me.

  1. brew uninstall --force node
  2. Visit https://nodejs.org/en/ and download the LTS version and install, the error was gone

This happened to me after installing yarn.

in a terminal:

brew uninstall --force --ignore-dependencies node
brew install node

if you have trouble symlinking node, in the same terminal:

sudo chown -R `whoami`:admin /usr/local/include
sudo chown -R `whoami`:admin /usr/local/bin
sudo chown -R `whoami`:admin /usr/local/share
sudo chown -R `whoami`:admin /usr/local/lib
brew link --overwrite node

Check that your re-installation worked by typing the following in the terminal:

node -v