Error: Cannot find module '../lib/utils/unsupported.js' while using Ionic

Solution 1:

Try to remove /usr/local/lib/node_modules/npm and reinstall node again. This should work.

On MacOS with Homebrew:

sudo rm -rf /usr/local/lib/node_modules/npm
brew reinstall node

Solution 2:

I followed the previous answers and reinstalled node. But I got this error.

Warning: The post-install step did not complete successfully You can try again using brew postinstall node

So I ran this command

sudo chown -R $(whoami):admin /usr/local/lib/node_modules/

Then ran

brew postinstall node

Solution 3:

I received a similar error and now have it working.

First make sure you have the latest version

brew update

Remove your previous instance of node:

brew uninstall node

Then reinstall the latest version:

brew install node

And then make sure it is symlinked into /usr/local if it isn't already. You would get an error to let you know to complete this step.

brew link --overwrite node 

More details on how to install/upgrade node are also available.