
Close and reopen your terminal, or open a new terminal window.Nvm (node Version Manager) is a better way, as it allows you to easily switch the version of node you’re using for each project that might need a different one. The typical way to install node is (was?) with Homebrew, you can change the version but it’s fiddly and easy to forget you’ve done it, meaning you’ll be using an old version of node for all of your projects. Thankfully, there are a few ways to downgrade or change the version of node. Of course, I should be upgrading packages to fix vulnerabilities, etc., but in the real world that’s not always immediately possible. A few of my projects still run Gulp version 3, which isn’t compatible with node 12 and above. # let's install different versions of nodeĪbove commands can be used for any linux based operating system like ubuntu as well.I recently (accidentally!) upgraded to version 12 of node on my Mac unsurprisingly it broke things. If you have curl or wget installed already on your mac os and want to install nvm using wget or curl try following commands: How To Install NVM on macOS using curl or wget? Nano ~/.bash_profile OR vim ~/.bash_profile # open bash profile in nano or vim editor # check to see if installation is successfulīrew uninstall -ignore-dependencies node # If you already have homebrew and want to upgradeĬd "$(brew -repo)" git fetch & git reset -hard origin/master & brew update In order to install nvm on your mac machine using home brew follow the steps below: # if you want to install different versions Once curl is installed you can run following commands to install nvm on linux machine: If you do not know how to install curl try following command: To install NVM on your linux or Ubuntu machine you should have curl installed. If you are working on different node projects where you have to switch between different node versions nvm will be your best option. It is known as Node Version Manager and you can easily install this tool on linux or mac or windows machine. NVM is a command line tool that allows you to manage different versions of NodeJS.
