How to avoid breaking globally installed node tools during Homebrew NVM upgrades

Learn how to prevent breaking globally installed node tools during nvm upgrades by correctly setting the $NVM_DIR.