After $npm install, Getting Error: Cannot find module '../lib/utils/unsupported.js'
- Uninstall node
brew uninstall --force node
- Remove the
/usr/local/lib/node_modules
folder - Install it again
brew install node
Assume this happens on MacOS, below solution works for me.
- brew uninstall --force node
- 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