Thursday 28 January 2016

Change the version of node installed on MAC OSX

Update or change the version of node on MAC OSX

If you want to install a particular version of node on you Mac, than homebrew will do it for you. Let's see how we can change the version of node installed.

First let's search the version of node available with brew search command


Ajeets-MacBook-Pro:~ zombie$ brew search node
homebrew/versions/node010 ✔      homebrew/versions/node06         leafnode                         nodebrew
homebrew/versions/node012 ✔      homebrew/versions/node08         node                             nodeenv
homebrew/versions/node04         homebrew/versions/node4-lts      node-build                       nodenv
Caskroom/cask/mindnode-pro       Caskroom/cask/node               Caskroom/cask/nodeclipse         Caskroom/cask/soundnode
Caskroom/cask/node-profiler      Caskroom/cask/nodebox            Caskroom/cask/printnode

As you can see there are tow ticks on the node version which means these two versions are installed. Now let's suppose we want to uninstall the node010 version and keep only node012 version. Uninstall the desired version by the following command.

brew uninstall homebrew/versions/node010

After this, the node010 would be uninstalled and if you check the version of node by command node -v than you might get the error 

Error: The brew link step did not complete successfully

This means the node is installed but the link to node is not setup properly. You can set the link to node by the following command

brew link node

Now check if the node version is shown properly


Ajeets-MacBook-Pro:~ zombie$ node -v
v0.12.9

 Congratulations! you have successfully changed the node version.

0 comments:

Post a Comment

 

Copyright @ 2013 Appychip.

Designed by Appychip & YouTube Channel