GUIDE to install nvm and yarn for macOS (updated July 2019)
DEPRECATED as of macOS 10.13 (High Sierra). See the newFixing npm On Mac OS X for Homebrew Users
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
Solution
This solution fixes the error caused by trying to run npm update npm -g
. Once you're finished, you also won't need to use sudo
to install npm modules globally.