Upgrade Node.js to the latest version on Mac OS











up vote
536
down vote

favorite
212












Currently I am using Node.js v0.6.16 on mac os x 10.7.4. Now I want to upgrade it to the latest Node.js v0.8.1. But after downloading and installing the latest package file from nodejs.org, I found that system is still using v0.6.16 instead of v0.8.1 when I typed "node -v" in a terminal. Is there any step that I have missed? Or should I thoroughly uninstall the old version before installing the latest one?



BTW, I know that nvm can help to manage the nodejs package



https://github.com/creationix/nvm/



Is there any way to upgrade the Node.js without using it?



I have googled this problem, but it seems to me that there is no very clear answer to this question for the latest Node.js. Many thanks.










share|improve this question
























  • Thanks Bob. I have updated my question.
    – afterglowlee
    Jul 1 '12 at 21:31










  • Not sure on an answer, but for clarification is a Node process running when you update it?
    – Bob Davies
    Jul 1 '12 at 22:03










  • No, I don't think there is any Node process running. And after restarting the OS, the "node -v" command still shows v0.6.16 is running.
    – afterglowlee
    Jul 2 '12 at 14:08










  • You might want to first double check you have it installed with brew apple.stackexchange.com/questions/101090/…
    – Adrien Be
    Oct 27 '17 at 15:42










  • Folks - this is a 6 year old question and with some equally old answers. No doubt that they were the best practices back then. But as of 2018, brew upgrade node should work just fine. Please see the answer by wprl below.
    – pscl
    Jun 13 at 7:58

















up vote
536
down vote

favorite
212












Currently I am using Node.js v0.6.16 on mac os x 10.7.4. Now I want to upgrade it to the latest Node.js v0.8.1. But after downloading and installing the latest package file from nodejs.org, I found that system is still using v0.6.16 instead of v0.8.1 when I typed "node -v" in a terminal. Is there any step that I have missed? Or should I thoroughly uninstall the old version before installing the latest one?



BTW, I know that nvm can help to manage the nodejs package



https://github.com/creationix/nvm/



Is there any way to upgrade the Node.js without using it?



I have googled this problem, but it seems to me that there is no very clear answer to this question for the latest Node.js. Many thanks.










share|improve this question
























  • Thanks Bob. I have updated my question.
    – afterglowlee
    Jul 1 '12 at 21:31










  • Not sure on an answer, but for clarification is a Node process running when you update it?
    – Bob Davies
    Jul 1 '12 at 22:03










  • No, I don't think there is any Node process running. And after restarting the OS, the "node -v" command still shows v0.6.16 is running.
    – afterglowlee
    Jul 2 '12 at 14:08










  • You might want to first double check you have it installed with brew apple.stackexchange.com/questions/101090/…
    – Adrien Be
    Oct 27 '17 at 15:42










  • Folks - this is a 6 year old question and with some equally old answers. No doubt that they were the best practices back then. But as of 2018, brew upgrade node should work just fine. Please see the answer by wprl below.
    – pscl
    Jun 13 at 7:58















up vote
536
down vote

favorite
212









up vote
536
down vote

favorite
212






212





Currently I am using Node.js v0.6.16 on mac os x 10.7.4. Now I want to upgrade it to the latest Node.js v0.8.1. But after downloading and installing the latest package file from nodejs.org, I found that system is still using v0.6.16 instead of v0.8.1 when I typed "node -v" in a terminal. Is there any step that I have missed? Or should I thoroughly uninstall the old version before installing the latest one?



BTW, I know that nvm can help to manage the nodejs package



https://github.com/creationix/nvm/



Is there any way to upgrade the Node.js without using it?



I have googled this problem, but it seems to me that there is no very clear answer to this question for the latest Node.js. Many thanks.










share|improve this question















Currently I am using Node.js v0.6.16 on mac os x 10.7.4. Now I want to upgrade it to the latest Node.js v0.8.1. But after downloading and installing the latest package file from nodejs.org, I found that system is still using v0.6.16 instead of v0.8.1 when I typed "node -v" in a terminal. Is there any step that I have missed? Or should I thoroughly uninstall the old version before installing the latest one?



BTW, I know that nvm can help to manage the nodejs package



https://github.com/creationix/nvm/



Is there any way to upgrade the Node.js without using it?



I have googled this problem, but it seems to me that there is no very clear answer to this question for the latest Node.js. Many thanks.







macos node.js upgrade






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 14 at 4:04









Grokify

7,12322137




7,12322137










asked Jul 1 '12 at 18:33









afterglowlee

3,33541321




3,33541321












  • Thanks Bob. I have updated my question.
    – afterglowlee
    Jul 1 '12 at 21:31










  • Not sure on an answer, but for clarification is a Node process running when you update it?
    – Bob Davies
    Jul 1 '12 at 22:03










  • No, I don't think there is any Node process running. And after restarting the OS, the "node -v" command still shows v0.6.16 is running.
    – afterglowlee
    Jul 2 '12 at 14:08










  • You might want to first double check you have it installed with brew apple.stackexchange.com/questions/101090/…
    – Adrien Be
    Oct 27 '17 at 15:42










  • Folks - this is a 6 year old question and with some equally old answers. No doubt that they were the best practices back then. But as of 2018, brew upgrade node should work just fine. Please see the answer by wprl below.
    – pscl
    Jun 13 at 7:58




















  • Thanks Bob. I have updated my question.
    – afterglowlee
    Jul 1 '12 at 21:31










  • Not sure on an answer, but for clarification is a Node process running when you update it?
    – Bob Davies
    Jul 1 '12 at 22:03










  • No, I don't think there is any Node process running. And after restarting the OS, the "node -v" command still shows v0.6.16 is running.
    – afterglowlee
    Jul 2 '12 at 14:08










  • You might want to first double check you have it installed with brew apple.stackexchange.com/questions/101090/…
    – Adrien Be
    Oct 27 '17 at 15:42










  • Folks - this is a 6 year old question and with some equally old answers. No doubt that they were the best practices back then. But as of 2018, brew upgrade node should work just fine. Please see the answer by wprl below.
    – pscl
    Jun 13 at 7:58


















Thanks Bob. I have updated my question.
– afterglowlee
Jul 1 '12 at 21:31




Thanks Bob. I have updated my question.
– afterglowlee
Jul 1 '12 at 21:31












Not sure on an answer, but for clarification is a Node process running when you update it?
– Bob Davies
Jul 1 '12 at 22:03




Not sure on an answer, but for clarification is a Node process running when you update it?
– Bob Davies
Jul 1 '12 at 22:03












No, I don't think there is any Node process running. And after restarting the OS, the "node -v" command still shows v0.6.16 is running.
– afterglowlee
Jul 2 '12 at 14:08




No, I don't think there is any Node process running. And after restarting the OS, the "node -v" command still shows v0.6.16 is running.
– afterglowlee
Jul 2 '12 at 14:08












You might want to first double check you have it installed with brew apple.stackexchange.com/questions/101090/…
– Adrien Be
Oct 27 '17 at 15:42




You might want to first double check you have it installed with brew apple.stackexchange.com/questions/101090/…
– Adrien Be
Oct 27 '17 at 15:42












Folks - this is a 6 year old question and with some equally old answers. No doubt that they were the best practices back then. But as of 2018, brew upgrade node should work just fine. Please see the answer by wprl below.
– pscl
Jun 13 at 7:58






Folks - this is a 6 year old question and with some equally old answers. No doubt that they were the best practices back then. But as of 2018, brew upgrade node should work just fine. Please see the answer by wprl below.
– pscl
Jun 13 at 7:58














21 Answers
21






active

oldest

votes

















up vote
970
down vote



accepted










Here's how I successfully upgraded from v0.8.18 to v0.10.20 without any other requirements like brew etc, (type these commands in terminal):





  1. sudo npm cache clean -f (force) clear you npm cache


  2. sudo npm install -g n install "n" (this might take a while)


  3. sudo n stable upgrade to lastest version


Note that sudo might prompt your password.



If the version number doesn't show up when typing node -v, you might have to reboot.



these instructions are found here as well: davidwalsh.name/upgrade-nodejs






share|improve this answer



















  • 5




    worked to update node from v0.10 to v0.12 in macos x snow leopard. Thank you.
    – Salvador P.
    Aug 5 '15 at 17:21






  • 51




    Please mark this as answer! Brew didn't work.
    – user3526
    Sep 12 '15 at 17:00






  • 2




    FWIW you can use 'n lts' to install the long term support version rather than the current stable version (i.e. 4.4.3 instead of 5.10.1 at the time of writing)
    – StephenT
    Apr 14 '16 at 20:02






  • 2




    Brew is occurring error. This is the correct answer, currently.
    – oguzhan00
    Apr 29 '17 at 18:22






  • 1




    you can do sudo n latest as the final step also
    – danimal
    May 3 '17 at 23:10


















up vote
760
down vote













If you initially installed Node.js with Homebrew, run:



brew update
brew upgrade node
npm update -g npm


Or as a one-liner:



brew update && brew upgrade node && npm update -g npm


Note: If you have npm --version < 2.7.1, you should replace update (above) with install.





A convenient way to change versions is to use nvm:



brew install nvm


To install the latest version of Node.js with nvm:



nvm install node




If you installed via a package, then download the latest version from nodejs.org.
See Installing Node.js and updating npm.






share|improve this answer



















  • 2




    @afterglowlee You might try uninstalling the old node before reinstalling the new one: stackoverflow.com/questions/9044788/…
    – wprl
    Jul 2 '12 at 21:08






  • 10




    I just upvoted this answer, but after 7 mins wait, brew told me installation failed... I also tried port upgrade node, but brew already messed up the package and port can't find node now... Finally I went to nodejs.org to download the installation package, and boom! Everything goes well, including the npm!
    – Jinzhao Huo
    Mar 4 '13 at 8:56








  • 3




    @Jinzhao It's recommended not to install more than one of Homebrew, MacPorts, or Fink.
    – wprl
    Mar 4 '13 at 18:36








  • 2




    in current brew version it states "If you update npm itself, do NOT use the npm update command. The upstream-recommended way to update npm is: npm install -g npm@latest"
    – Pascal
    Mar 20 '15 at 9:44






  • 3




    Run npm install -g node after following above instructions if your node version is still not updated.
    – Thilina Hasantha
    Sep 24 '17 at 6:20




















up vote
153
down vote













Because this seems to be at the top of Google when searching for how to upgrade nodejs on mac I will offer my tip for anyone coming along in the future despite its age.



Upgrading via NPM

You can use the method described by @Mathias above or choose the following simpler method via the terminal.



sudo npm cache clean -f
sudo npm install -g n
sudo n stable


After which you may opt to confirm the upgrade



node -v


Your nodejs should have upgraded to the latest version. If you wish to upgrade to a specific one say v0.8.19 then instead of



sudo n stable


use



sudo n 0.8.19


EDIT
Avoid using sudo unless you need to. Refer to comment by Steve in the comments






share|improve this answer



















  • 4




    Why would you downvote an answer and not add a comment explaining why?
    – Kennedy Nyaga
    Oct 1 '15 at 14:54










  • Because you advice to use sudo.
    – OZ_
    Nov 16 '15 at 20:53






  • 2




    This works, but: is it really necessary to use the --force flag on cache clean? And I didn't need sudo for the first two commands.
    – Steve Bennett
    Jan 27 '16 at 1:01










  • Thanks @SteveBennett for adding that, I added sudo in order to include newbies who would need it, rather than leave them stranded. Moreover, having sudo will work in both cases.
    – Kennedy Nyaga
    Jan 28 '16 at 5:22






  • 4




    Sometimes using sudo when it's not needed actually makes a mess, because you end up with files owned by root, which then can't be modified without sudo.
    – Steve Bennett
    Jan 28 '16 at 6:21


















up vote
48
down vote













Go to http://nodejs.org and download and run the installer.
It works now - for me at least.






share|improve this answer





















  • Do you know by any chance how installed jode.js updates in OS/X?
    – Dimitrios Mistriotis
    Nov 9 '12 at 11:06










  • Im not sure I understand what you are asking
    – Spoeken
    Nov 19 '12 at 14:22






  • 1




    Sorry for the confusion (wrote in a hurry). I have installed node.js straight from the site's download link, Current Version: v0.8.14. When say v0.8.15 gets released, will I have to download it again, will it auto-update, will it call-home and inform me? With homebrew for example I was doing a brew upgrade (so it was up to me)
    – Dimitrios Mistriotis
    Nov 19 '12 at 16:21






  • 1




    I don't think it will call home. You will have to check regularly and download the new version from their webpage i think. But im not 100% on this.
    – Spoeken
    Nov 21 '12 at 21:12






  • 1




    probably the easiest way here.
    – Mohit
    Dec 13 '16 at 13:58


















up vote
39
down vote













You could install nvm and have multiple versions of Node.js installed.



curl https://raw.github.com/creationix/nvm/master/install.sh | sh
source ~/.nvm/nvm.sh


and then run:



nvm install 0.8.22  #(or whatever version of Node.js you want)


you can see what versions you have installed with :



nvm list


and you can change between versions with:



nvm use 0.8.22


The great thing about using NVM is that you can test different versions alongside one another. If different apps require different versions of Node.js, you can run them both.






share|improve this answer

















  • 2




    I am using this method now. It seems to me that this is the best way to keep multiple versions running at the same machine.
    – afterglowlee
    Apr 14 '13 at 21:19


















up vote
23
down vote













I use Node version manager (called n) for it.



npm install -g n


then



n latest


OR



n stable





share|improve this answer

















  • 1




    LTS version n lts
    – Sergio Rodrigues
    Nov 14 '16 at 18:26


















up vote
23
down vote













Simply go to node JS Website and install the latest version.




Do install latest version instead of the recommended stable version. It will give you freedom to use latest ES6 Features on node.




Can be Found here Node JS.



also to update npm, you will have to use this command.



sudo npm i -g npm@latest




All your projects will work fine.






Other option for mac :: brew update && brew install node && npm -g npm






share|improve this answer






























    up vote
    19
    down vote













    On macOS the homebrew recommended way is to run



    brew install node
    npm install -g npm@latest


    Screenshot of Terminal Commands






    share|improve this answer























    • why is this the correct way?
      – SuperUberDuper
      Feb 24 '15 at 15:09






    • 1




      It will install the truly latest version, not just the most current brewed version.
      – Nick Woodhams
      Feb 24 '15 at 21:45


















    up vote
    10
    down vote













    I am able to upgrade the node using following command



    nvm install node --reinstall-packages-from=node





    share|improve this answer





















    • This one worked for me. Thanks!
      – Khom Nazid
      Jul 22 at 14:43


















    up vote
    7
    down vote













    sadly, n doesn't worked for me. I use node version manager or nvm and it works like a charm. heres the link on how to install nvm: https://github.com/creationix/nvm#installation





    • nvm i 8.11.2 upgrade to latest LTS


    • nvm use 8.11.2 use it


    • node -v check your latest version






    share|improve this answer

















    • 1




      This is the one that worked for me. I tried several of the top comments, but after following the steps, node is still stuck at v6. Thanks!
      – Geraldine Golong
      Jul 4 at 7:25


















    up vote
    6
    down vote













    Go to the website nodejs.org and download the latest pkg then install.
    it works for me



    I used brew to upgrade my node. It has installed but it located in /usr/local/Cellar/node/5.5.0 and there is a default node in /usr/local/bin/node which bothers me. I don't want to make soft link because I don't really know how brew is organized.
    So I download the pkg file, installed and I got this info:



    Node.js was installed at



    /usr/local/bin/node


    npm was installed at



    /usr/local/bin/npm


    Make sure that /usr/local/bin is in your $PATH.



    Now the upgrade is completed






    share|improve this answer






























      up vote
      5
      down vote













      You can just go to nodejs.org and download the newest package. It will update appropriately for you. NPM will be updated as well.






      share|improve this answer

















      • 2




        By far the easiest, if you initially installed it via de the website.
        – Elwin
        Jun 8 '16 at 11:27


















      up vote
      3
      down vote













      You can run but you can't hide... At the end you will be using NVM anyways.






      share|improve this answer

















      • 2




        Or the 'n' package... See Kenny West's answer if you'd like a simple package manager you can install via npm.
        – depthfirstdesigner
        Oct 15 '14 at 20:52


















      up vote
      3
      down vote













      I think the simplest way to use the newest version of Node.js is to get the newest Node.js pkg file in the website https://nodejs.org/en/download/current/
      if you want to use different version of Node.js you can use nvm or n to manage it.






      share|improve this answer




























        up vote
        2
        down vote













        sudo npm install -g n


        and then



        sudo n latest for linux/mac users


        For Windows please reinstall node.






        share|improve this answer






























          up vote
          2
          down vote













          Nvm
          Nvm is a script-based node version manager. You can install it easily with a curl and bash one-liner as described in the documentation. It's also available on Homebrew.



          Assuming you have successfully installed nvm. The following will install the latest version of node.



           nvm install node --reinstall-packages-from=node


          The last option installs all global npm packages over to your new version. This way packages like mocha and node-inspector keep working.



          N
          N is an npm-based node version manager. You can install it by installing first some version of node and then running npm install -g n.



          Assuming you have successfully installed n. The following will install the latest version of node.



          sudo n latest


          Homebrew
          Homebrew is one of the two popular package managers for Mac. Assuming you have previously installed node with brew install node. You can get up-to-date with formulae and upgrade to the latest Node.js version with the following.



          1 brew update
          2 brew upgrade node


          MacPorts
          MacPorts is the another package manager for Mac. The following will update the local ports tree to get access to updated versions. Then it will install the latest version of Node.js. This works even if you have previous version of the package installed.



          1 sudo port selfupdate
          2 sudo port install nodejs-devel





          share|improve this answer





















          • brew upgrade node is a breeze
            – khawarizmi
            Jul 20 at 15:11










          • This is what worked for me on OSX. I probably had NVM installed because node -v kept giving me 6.11.1 even after commands related to n latest and so on. The brew upgrade one worked. Thanks.
            – Khom Nazid
            Jul 22 at 14:41


















          up vote
          1
          down vote













          Use nvm to upgrade node as per the project requirement..



          install nvm through homebrew..
          brew update
          brew install nvm
          mkdir ~/.nvm
          nano ~/.bash_profile



          In your .bash_profile file (you may be using an other file, according to your shell), add the following :



          export NVM_DIR=~/.nvm
          source $(brew --prefix nvm)/nvm.sh



          source ~/.bash_profile
          echo $NVM_DIR






          share|improve this answer




























            up vote
            0
            down vote













            These 2 methods I tried are not working:




            1. Use npm


            sudo npm cache clean -f



            sudo npm install -g n



            sudo n stable




            1. Manual install node from official website (https://nodejs.org/en/)


            After trying, node -v still shows the old version of node.





            Below method works for me:



            Step 1: Install nvm (for more details: https://github.com/creationix/nvm#installation)



            Open terminal and type this command:



            curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash



            Close terminal and reopen it.



            Type this command to check if nvm is installed:



            command -v nvm



            enter image description here



            Step 2: To download, compile, and install the latest release of node, type this:



            nvm install node ("node" is an alias for the latest version)



            To check if node gets the latest version (v10.11.0).



            enter image description here



            Installing the latest node also installs the latest npm.



            Check if npm gets the latest version (6.4.1).



            enter image description here






            share|improve this answer






























              up vote
              0
              down vote













              for latest release:
              nvm install node



              specific version:
              nvm install 6.14.4



              https://github.com/creationix/nvm






              share|improve this answer




























                up vote
                0
                down vote













                I had the same problem. This is what worked for me because I downloaded and installed node.js globally from the node.js website.



                What I did was Give NVM (Node Version Manager) a try. Please do the commands in the following order in your terminal




                1. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                2. command -v nvm


                3. nvm install node


                4. node -v (to confirm the update)







                share|improve this answer




























                  up vote
                  -1
                  down vote













                  I was able to update in ~20 seconds with just one line of code



                  sudo n latest


                  Other commands weren't working for me, but this one worked. Hope it helps somebody.






                  share|improve this answer




















                    protected by Community Mar 24 at 5:47



                    Thank you for your interest in this question.
                    Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                    Would you like to answer one of these unanswered questions instead?














                    21 Answers
                    21






                    active

                    oldest

                    votes








                    21 Answers
                    21






                    active

                    oldest

                    votes









                    active

                    oldest

                    votes






                    active

                    oldest

                    votes








                    up vote
                    970
                    down vote



                    accepted










                    Here's how I successfully upgraded from v0.8.18 to v0.10.20 without any other requirements like brew etc, (type these commands in terminal):





                    1. sudo npm cache clean -f (force) clear you npm cache


                    2. sudo npm install -g n install "n" (this might take a while)


                    3. sudo n stable upgrade to lastest version


                    Note that sudo might prompt your password.



                    If the version number doesn't show up when typing node -v, you might have to reboot.



                    these instructions are found here as well: davidwalsh.name/upgrade-nodejs






                    share|improve this answer



















                    • 5




                      worked to update node from v0.10 to v0.12 in macos x snow leopard. Thank you.
                      – Salvador P.
                      Aug 5 '15 at 17:21






                    • 51




                      Please mark this as answer! Brew didn't work.
                      – user3526
                      Sep 12 '15 at 17:00






                    • 2




                      FWIW you can use 'n lts' to install the long term support version rather than the current stable version (i.e. 4.4.3 instead of 5.10.1 at the time of writing)
                      – StephenT
                      Apr 14 '16 at 20:02






                    • 2




                      Brew is occurring error. This is the correct answer, currently.
                      – oguzhan00
                      Apr 29 '17 at 18:22






                    • 1




                      you can do sudo n latest as the final step also
                      – danimal
                      May 3 '17 at 23:10















                    up vote
                    970
                    down vote



                    accepted










                    Here's how I successfully upgraded from v0.8.18 to v0.10.20 without any other requirements like brew etc, (type these commands in terminal):





                    1. sudo npm cache clean -f (force) clear you npm cache


                    2. sudo npm install -g n install "n" (this might take a while)


                    3. sudo n stable upgrade to lastest version


                    Note that sudo might prompt your password.



                    If the version number doesn't show up when typing node -v, you might have to reboot.



                    these instructions are found here as well: davidwalsh.name/upgrade-nodejs






                    share|improve this answer



















                    • 5




                      worked to update node from v0.10 to v0.12 in macos x snow leopard. Thank you.
                      – Salvador P.
                      Aug 5 '15 at 17:21






                    • 51




                      Please mark this as answer! Brew didn't work.
                      – user3526
                      Sep 12 '15 at 17:00






                    • 2




                      FWIW you can use 'n lts' to install the long term support version rather than the current stable version (i.e. 4.4.3 instead of 5.10.1 at the time of writing)
                      – StephenT
                      Apr 14 '16 at 20:02






                    • 2




                      Brew is occurring error. This is the correct answer, currently.
                      – oguzhan00
                      Apr 29 '17 at 18:22






                    • 1




                      you can do sudo n latest as the final step also
                      – danimal
                      May 3 '17 at 23:10













                    up vote
                    970
                    down vote



                    accepted







                    up vote
                    970
                    down vote



                    accepted






                    Here's how I successfully upgraded from v0.8.18 to v0.10.20 without any other requirements like brew etc, (type these commands in terminal):





                    1. sudo npm cache clean -f (force) clear you npm cache


                    2. sudo npm install -g n install "n" (this might take a while)


                    3. sudo n stable upgrade to lastest version


                    Note that sudo might prompt your password.



                    If the version number doesn't show up when typing node -v, you might have to reboot.



                    these instructions are found here as well: davidwalsh.name/upgrade-nodejs






                    share|improve this answer














                    Here's how I successfully upgraded from v0.8.18 to v0.10.20 without any other requirements like brew etc, (type these commands in terminal):





                    1. sudo npm cache clean -f (force) clear you npm cache


                    2. sudo npm install -g n install "n" (this might take a while)


                    3. sudo n stable upgrade to lastest version


                    Note that sudo might prompt your password.



                    If the version number doesn't show up when typing node -v, you might have to reboot.



                    these instructions are found here as well: davidwalsh.name/upgrade-nodejs







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jun 1 '16 at 3:08









                    Rimian

                    19.8k99097




                    19.8k99097










                    answered Oct 12 '13 at 11:36









                    Johan Dettmar

                    15.7k32020




                    15.7k32020








                    • 5




                      worked to update node from v0.10 to v0.12 in macos x snow leopard. Thank you.
                      – Salvador P.
                      Aug 5 '15 at 17:21






                    • 51




                      Please mark this as answer! Brew didn't work.
                      – user3526
                      Sep 12 '15 at 17:00






                    • 2




                      FWIW you can use 'n lts' to install the long term support version rather than the current stable version (i.e. 4.4.3 instead of 5.10.1 at the time of writing)
                      – StephenT
                      Apr 14 '16 at 20:02






                    • 2




                      Brew is occurring error. This is the correct answer, currently.
                      – oguzhan00
                      Apr 29 '17 at 18:22






                    • 1




                      you can do sudo n latest as the final step also
                      – danimal
                      May 3 '17 at 23:10














                    • 5




                      worked to update node from v0.10 to v0.12 in macos x snow leopard. Thank you.
                      – Salvador P.
                      Aug 5 '15 at 17:21






                    • 51




                      Please mark this as answer! Brew didn't work.
                      – user3526
                      Sep 12 '15 at 17:00






                    • 2




                      FWIW you can use 'n lts' to install the long term support version rather than the current stable version (i.e. 4.4.3 instead of 5.10.1 at the time of writing)
                      – StephenT
                      Apr 14 '16 at 20:02






                    • 2




                      Brew is occurring error. This is the correct answer, currently.
                      – oguzhan00
                      Apr 29 '17 at 18:22






                    • 1




                      you can do sudo n latest as the final step also
                      – danimal
                      May 3 '17 at 23:10








                    5




                    5




                    worked to update node from v0.10 to v0.12 in macos x snow leopard. Thank you.
                    – Salvador P.
                    Aug 5 '15 at 17:21




                    worked to update node from v0.10 to v0.12 in macos x snow leopard. Thank you.
                    – Salvador P.
                    Aug 5 '15 at 17:21




                    51




                    51




                    Please mark this as answer! Brew didn't work.
                    – user3526
                    Sep 12 '15 at 17:00




                    Please mark this as answer! Brew didn't work.
                    – user3526
                    Sep 12 '15 at 17:00




                    2




                    2




                    FWIW you can use 'n lts' to install the long term support version rather than the current stable version (i.e. 4.4.3 instead of 5.10.1 at the time of writing)
                    – StephenT
                    Apr 14 '16 at 20:02




                    FWIW you can use 'n lts' to install the long term support version rather than the current stable version (i.e. 4.4.3 instead of 5.10.1 at the time of writing)
                    – StephenT
                    Apr 14 '16 at 20:02




                    2




                    2




                    Brew is occurring error. This is the correct answer, currently.
                    – oguzhan00
                    Apr 29 '17 at 18:22




                    Brew is occurring error. This is the correct answer, currently.
                    – oguzhan00
                    Apr 29 '17 at 18:22




                    1




                    1




                    you can do sudo n latest as the final step also
                    – danimal
                    May 3 '17 at 23:10




                    you can do sudo n latest as the final step also
                    – danimal
                    May 3 '17 at 23:10












                    up vote
                    760
                    down vote













                    If you initially installed Node.js with Homebrew, run:



                    brew update
                    brew upgrade node
                    npm update -g npm


                    Or as a one-liner:



                    brew update && brew upgrade node && npm update -g npm


                    Note: If you have npm --version < 2.7.1, you should replace update (above) with install.





                    A convenient way to change versions is to use nvm:



                    brew install nvm


                    To install the latest version of Node.js with nvm:



                    nvm install node




                    If you installed via a package, then download the latest version from nodejs.org.
                    See Installing Node.js and updating npm.






                    share|improve this answer



















                    • 2




                      @afterglowlee You might try uninstalling the old node before reinstalling the new one: stackoverflow.com/questions/9044788/…
                      – wprl
                      Jul 2 '12 at 21:08






                    • 10




                      I just upvoted this answer, but after 7 mins wait, brew told me installation failed... I also tried port upgrade node, but brew already messed up the package and port can't find node now... Finally I went to nodejs.org to download the installation package, and boom! Everything goes well, including the npm!
                      – Jinzhao Huo
                      Mar 4 '13 at 8:56








                    • 3




                      @Jinzhao It's recommended not to install more than one of Homebrew, MacPorts, or Fink.
                      – wprl
                      Mar 4 '13 at 18:36








                    • 2




                      in current brew version it states "If you update npm itself, do NOT use the npm update command. The upstream-recommended way to update npm is: npm install -g npm@latest"
                      – Pascal
                      Mar 20 '15 at 9:44






                    • 3




                      Run npm install -g node after following above instructions if your node version is still not updated.
                      – Thilina Hasantha
                      Sep 24 '17 at 6:20

















                    up vote
                    760
                    down vote













                    If you initially installed Node.js with Homebrew, run:



                    brew update
                    brew upgrade node
                    npm update -g npm


                    Or as a one-liner:



                    brew update && brew upgrade node && npm update -g npm


                    Note: If you have npm --version < 2.7.1, you should replace update (above) with install.





                    A convenient way to change versions is to use nvm:



                    brew install nvm


                    To install the latest version of Node.js with nvm:



                    nvm install node




                    If you installed via a package, then download the latest version from nodejs.org.
                    See Installing Node.js and updating npm.






                    share|improve this answer



















                    • 2




                      @afterglowlee You might try uninstalling the old node before reinstalling the new one: stackoverflow.com/questions/9044788/…
                      – wprl
                      Jul 2 '12 at 21:08






                    • 10




                      I just upvoted this answer, but after 7 mins wait, brew told me installation failed... I also tried port upgrade node, but brew already messed up the package and port can't find node now... Finally I went to nodejs.org to download the installation package, and boom! Everything goes well, including the npm!
                      – Jinzhao Huo
                      Mar 4 '13 at 8:56








                    • 3




                      @Jinzhao It's recommended not to install more than one of Homebrew, MacPorts, or Fink.
                      – wprl
                      Mar 4 '13 at 18:36








                    • 2




                      in current brew version it states "If you update npm itself, do NOT use the npm update command. The upstream-recommended way to update npm is: npm install -g npm@latest"
                      – Pascal
                      Mar 20 '15 at 9:44






                    • 3




                      Run npm install -g node after following above instructions if your node version is still not updated.
                      – Thilina Hasantha
                      Sep 24 '17 at 6:20















                    up vote
                    760
                    down vote










                    up vote
                    760
                    down vote









                    If you initially installed Node.js with Homebrew, run:



                    brew update
                    brew upgrade node
                    npm update -g npm


                    Or as a one-liner:



                    brew update && brew upgrade node && npm update -g npm


                    Note: If you have npm --version < 2.7.1, you should replace update (above) with install.





                    A convenient way to change versions is to use nvm:



                    brew install nvm


                    To install the latest version of Node.js with nvm:



                    nvm install node




                    If you installed via a package, then download the latest version from nodejs.org.
                    See Installing Node.js and updating npm.






                    share|improve this answer














                    If you initially installed Node.js with Homebrew, run:



                    brew update
                    brew upgrade node
                    npm update -g npm


                    Or as a one-liner:



                    brew update && brew upgrade node && npm update -g npm


                    Note: If you have npm --version < 2.7.1, you should replace update (above) with install.





                    A convenient way to change versions is to use nvm:



                    brew install nvm


                    To install the latest version of Node.js with nvm:



                    nvm install node




                    If you installed via a package, then download the latest version from nodejs.org.
                    See Installing Node.js and updating npm.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Oct 4 at 14:33

























                    answered Jul 2 '12 at 17:24









                    wprl

                    18k94467




                    18k94467








                    • 2




                      @afterglowlee You might try uninstalling the old node before reinstalling the new one: stackoverflow.com/questions/9044788/…
                      – wprl
                      Jul 2 '12 at 21:08






                    • 10




                      I just upvoted this answer, but after 7 mins wait, brew told me installation failed... I also tried port upgrade node, but brew already messed up the package and port can't find node now... Finally I went to nodejs.org to download the installation package, and boom! Everything goes well, including the npm!
                      – Jinzhao Huo
                      Mar 4 '13 at 8:56








                    • 3




                      @Jinzhao It's recommended not to install more than one of Homebrew, MacPorts, or Fink.
                      – wprl
                      Mar 4 '13 at 18:36








                    • 2




                      in current brew version it states "If you update npm itself, do NOT use the npm update command. The upstream-recommended way to update npm is: npm install -g npm@latest"
                      – Pascal
                      Mar 20 '15 at 9:44






                    • 3




                      Run npm install -g node after following above instructions if your node version is still not updated.
                      – Thilina Hasantha
                      Sep 24 '17 at 6:20
















                    • 2




                      @afterglowlee You might try uninstalling the old node before reinstalling the new one: stackoverflow.com/questions/9044788/…
                      – wprl
                      Jul 2 '12 at 21:08






                    • 10




                      I just upvoted this answer, but after 7 mins wait, brew told me installation failed... I also tried port upgrade node, but brew already messed up the package and port can't find node now... Finally I went to nodejs.org to download the installation package, and boom! Everything goes well, including the npm!
                      – Jinzhao Huo
                      Mar 4 '13 at 8:56








                    • 3




                      @Jinzhao It's recommended not to install more than one of Homebrew, MacPorts, or Fink.
                      – wprl
                      Mar 4 '13 at 18:36








                    • 2




                      in current brew version it states "If you update npm itself, do NOT use the npm update command. The upstream-recommended way to update npm is: npm install -g npm@latest"
                      – Pascal
                      Mar 20 '15 at 9:44






                    • 3




                      Run npm install -g node after following above instructions if your node version is still not updated.
                      – Thilina Hasantha
                      Sep 24 '17 at 6:20










                    2




                    2




                    @afterglowlee You might try uninstalling the old node before reinstalling the new one: stackoverflow.com/questions/9044788/…
                    – wprl
                    Jul 2 '12 at 21:08




                    @afterglowlee You might try uninstalling the old node before reinstalling the new one: stackoverflow.com/questions/9044788/…
                    – wprl
                    Jul 2 '12 at 21:08




                    10




                    10




                    I just upvoted this answer, but after 7 mins wait, brew told me installation failed... I also tried port upgrade node, but brew already messed up the package and port can't find node now... Finally I went to nodejs.org to download the installation package, and boom! Everything goes well, including the npm!
                    – Jinzhao Huo
                    Mar 4 '13 at 8:56






                    I just upvoted this answer, but after 7 mins wait, brew told me installation failed... I also tried port upgrade node, but brew already messed up the package and port can't find node now... Finally I went to nodejs.org to download the installation package, and boom! Everything goes well, including the npm!
                    – Jinzhao Huo
                    Mar 4 '13 at 8:56






                    3




                    3




                    @Jinzhao It's recommended not to install more than one of Homebrew, MacPorts, or Fink.
                    – wprl
                    Mar 4 '13 at 18:36






                    @Jinzhao It's recommended not to install more than one of Homebrew, MacPorts, or Fink.
                    – wprl
                    Mar 4 '13 at 18:36






                    2




                    2




                    in current brew version it states "If you update npm itself, do NOT use the npm update command. The upstream-recommended way to update npm is: npm install -g npm@latest"
                    – Pascal
                    Mar 20 '15 at 9:44




                    in current brew version it states "If you update npm itself, do NOT use the npm update command. The upstream-recommended way to update npm is: npm install -g npm@latest"
                    – Pascal
                    Mar 20 '15 at 9:44




                    3




                    3




                    Run npm install -g node after following above instructions if your node version is still not updated.
                    – Thilina Hasantha
                    Sep 24 '17 at 6:20






                    Run npm install -g node after following above instructions if your node version is still not updated.
                    – Thilina Hasantha
                    Sep 24 '17 at 6:20












                    up vote
                    153
                    down vote













                    Because this seems to be at the top of Google when searching for how to upgrade nodejs on mac I will offer my tip for anyone coming along in the future despite its age.



                    Upgrading via NPM

                    You can use the method described by @Mathias above or choose the following simpler method via the terminal.



                    sudo npm cache clean -f
                    sudo npm install -g n
                    sudo n stable


                    After which you may opt to confirm the upgrade



                    node -v


                    Your nodejs should have upgraded to the latest version. If you wish to upgrade to a specific one say v0.8.19 then instead of



                    sudo n stable


                    use



                    sudo n 0.8.19


                    EDIT
                    Avoid using sudo unless you need to. Refer to comment by Steve in the comments






                    share|improve this answer



















                    • 4




                      Why would you downvote an answer and not add a comment explaining why?
                      – Kennedy Nyaga
                      Oct 1 '15 at 14:54










                    • Because you advice to use sudo.
                      – OZ_
                      Nov 16 '15 at 20:53






                    • 2




                      This works, but: is it really necessary to use the --force flag on cache clean? And I didn't need sudo for the first two commands.
                      – Steve Bennett
                      Jan 27 '16 at 1:01










                    • Thanks @SteveBennett for adding that, I added sudo in order to include newbies who would need it, rather than leave them stranded. Moreover, having sudo will work in both cases.
                      – Kennedy Nyaga
                      Jan 28 '16 at 5:22






                    • 4




                      Sometimes using sudo when it's not needed actually makes a mess, because you end up with files owned by root, which then can't be modified without sudo.
                      – Steve Bennett
                      Jan 28 '16 at 6:21















                    up vote
                    153
                    down vote













                    Because this seems to be at the top of Google when searching for how to upgrade nodejs on mac I will offer my tip for anyone coming along in the future despite its age.



                    Upgrading via NPM

                    You can use the method described by @Mathias above or choose the following simpler method via the terminal.



                    sudo npm cache clean -f
                    sudo npm install -g n
                    sudo n stable


                    After which you may opt to confirm the upgrade



                    node -v


                    Your nodejs should have upgraded to the latest version. If you wish to upgrade to a specific one say v0.8.19 then instead of



                    sudo n stable


                    use



                    sudo n 0.8.19


                    EDIT
                    Avoid using sudo unless you need to. Refer to comment by Steve in the comments






                    share|improve this answer



















                    • 4




                      Why would you downvote an answer and not add a comment explaining why?
                      – Kennedy Nyaga
                      Oct 1 '15 at 14:54










                    • Because you advice to use sudo.
                      – OZ_
                      Nov 16 '15 at 20:53






                    • 2




                      This works, but: is it really necessary to use the --force flag on cache clean? And I didn't need sudo for the first two commands.
                      – Steve Bennett
                      Jan 27 '16 at 1:01










                    • Thanks @SteveBennett for adding that, I added sudo in order to include newbies who would need it, rather than leave them stranded. Moreover, having sudo will work in both cases.
                      – Kennedy Nyaga
                      Jan 28 '16 at 5:22






                    • 4




                      Sometimes using sudo when it's not needed actually makes a mess, because you end up with files owned by root, which then can't be modified without sudo.
                      – Steve Bennett
                      Jan 28 '16 at 6:21













                    up vote
                    153
                    down vote










                    up vote
                    153
                    down vote









                    Because this seems to be at the top of Google when searching for how to upgrade nodejs on mac I will offer my tip for anyone coming along in the future despite its age.



                    Upgrading via NPM

                    You can use the method described by @Mathias above or choose the following simpler method via the terminal.



                    sudo npm cache clean -f
                    sudo npm install -g n
                    sudo n stable


                    After which you may opt to confirm the upgrade



                    node -v


                    Your nodejs should have upgraded to the latest version. If you wish to upgrade to a specific one say v0.8.19 then instead of



                    sudo n stable


                    use



                    sudo n 0.8.19


                    EDIT
                    Avoid using sudo unless you need to. Refer to comment by Steve in the comments






                    share|improve this answer














                    Because this seems to be at the top of Google when searching for how to upgrade nodejs on mac I will offer my tip for anyone coming along in the future despite its age.



                    Upgrading via NPM

                    You can use the method described by @Mathias above or choose the following simpler method via the terminal.



                    sudo npm cache clean -f
                    sudo npm install -g n
                    sudo n stable


                    After which you may opt to confirm the upgrade



                    node -v


                    Your nodejs should have upgraded to the latest version. If you wish to upgrade to a specific one say v0.8.19 then instead of



                    sudo n stable


                    use



                    sudo n 0.8.19


                    EDIT
                    Avoid using sudo unless you need to. Refer to comment by Steve in the comments







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jan 28 '16 at 9:01

























                    answered Dec 27 '13 at 6:36









                    Kennedy Nyaga

                    2,55611719




                    2,55611719








                    • 4




                      Why would you downvote an answer and not add a comment explaining why?
                      – Kennedy Nyaga
                      Oct 1 '15 at 14:54










                    • Because you advice to use sudo.
                      – OZ_
                      Nov 16 '15 at 20:53






                    • 2




                      This works, but: is it really necessary to use the --force flag on cache clean? And I didn't need sudo for the first two commands.
                      – Steve Bennett
                      Jan 27 '16 at 1:01










                    • Thanks @SteveBennett for adding that, I added sudo in order to include newbies who would need it, rather than leave them stranded. Moreover, having sudo will work in both cases.
                      – Kennedy Nyaga
                      Jan 28 '16 at 5:22






                    • 4




                      Sometimes using sudo when it's not needed actually makes a mess, because you end up with files owned by root, which then can't be modified without sudo.
                      – Steve Bennett
                      Jan 28 '16 at 6:21














                    • 4




                      Why would you downvote an answer and not add a comment explaining why?
                      – Kennedy Nyaga
                      Oct 1 '15 at 14:54










                    • Because you advice to use sudo.
                      – OZ_
                      Nov 16 '15 at 20:53






                    • 2




                      This works, but: is it really necessary to use the --force flag on cache clean? And I didn't need sudo for the first two commands.
                      – Steve Bennett
                      Jan 27 '16 at 1:01










                    • Thanks @SteveBennett for adding that, I added sudo in order to include newbies who would need it, rather than leave them stranded. Moreover, having sudo will work in both cases.
                      – Kennedy Nyaga
                      Jan 28 '16 at 5:22






                    • 4




                      Sometimes using sudo when it's not needed actually makes a mess, because you end up with files owned by root, which then can't be modified without sudo.
                      – Steve Bennett
                      Jan 28 '16 at 6:21








                    4




                    4




                    Why would you downvote an answer and not add a comment explaining why?
                    – Kennedy Nyaga
                    Oct 1 '15 at 14:54




                    Why would you downvote an answer and not add a comment explaining why?
                    – Kennedy Nyaga
                    Oct 1 '15 at 14:54












                    Because you advice to use sudo.
                    – OZ_
                    Nov 16 '15 at 20:53




                    Because you advice to use sudo.
                    – OZ_
                    Nov 16 '15 at 20:53




                    2




                    2




                    This works, but: is it really necessary to use the --force flag on cache clean? And I didn't need sudo for the first two commands.
                    – Steve Bennett
                    Jan 27 '16 at 1:01




                    This works, but: is it really necessary to use the --force flag on cache clean? And I didn't need sudo for the first two commands.
                    – Steve Bennett
                    Jan 27 '16 at 1:01












                    Thanks @SteveBennett for adding that, I added sudo in order to include newbies who would need it, rather than leave them stranded. Moreover, having sudo will work in both cases.
                    – Kennedy Nyaga
                    Jan 28 '16 at 5:22




                    Thanks @SteveBennett for adding that, I added sudo in order to include newbies who would need it, rather than leave them stranded. Moreover, having sudo will work in both cases.
                    – Kennedy Nyaga
                    Jan 28 '16 at 5:22




                    4




                    4




                    Sometimes using sudo when it's not needed actually makes a mess, because you end up with files owned by root, which then can't be modified without sudo.
                    – Steve Bennett
                    Jan 28 '16 at 6:21




                    Sometimes using sudo when it's not needed actually makes a mess, because you end up with files owned by root, which then can't be modified without sudo.
                    – Steve Bennett
                    Jan 28 '16 at 6:21










                    up vote
                    48
                    down vote













                    Go to http://nodejs.org and download and run the installer.
                    It works now - for me at least.






                    share|improve this answer





















                    • Do you know by any chance how installed jode.js updates in OS/X?
                      – Dimitrios Mistriotis
                      Nov 9 '12 at 11:06










                    • Im not sure I understand what you are asking
                      – Spoeken
                      Nov 19 '12 at 14:22






                    • 1




                      Sorry for the confusion (wrote in a hurry). I have installed node.js straight from the site's download link, Current Version: v0.8.14. When say v0.8.15 gets released, will I have to download it again, will it auto-update, will it call-home and inform me? With homebrew for example I was doing a brew upgrade (so it was up to me)
                      – Dimitrios Mistriotis
                      Nov 19 '12 at 16:21






                    • 1




                      I don't think it will call home. You will have to check regularly and download the new version from their webpage i think. But im not 100% on this.
                      – Spoeken
                      Nov 21 '12 at 21:12






                    • 1




                      probably the easiest way here.
                      – Mohit
                      Dec 13 '16 at 13:58















                    up vote
                    48
                    down vote













                    Go to http://nodejs.org and download and run the installer.
                    It works now - for me at least.






                    share|improve this answer





















                    • Do you know by any chance how installed jode.js updates in OS/X?
                      – Dimitrios Mistriotis
                      Nov 9 '12 at 11:06










                    • Im not sure I understand what you are asking
                      – Spoeken
                      Nov 19 '12 at 14:22






                    • 1




                      Sorry for the confusion (wrote in a hurry). I have installed node.js straight from the site's download link, Current Version: v0.8.14. When say v0.8.15 gets released, will I have to download it again, will it auto-update, will it call-home and inform me? With homebrew for example I was doing a brew upgrade (so it was up to me)
                      – Dimitrios Mistriotis
                      Nov 19 '12 at 16:21






                    • 1




                      I don't think it will call home. You will have to check regularly and download the new version from their webpage i think. But im not 100% on this.
                      – Spoeken
                      Nov 21 '12 at 21:12






                    • 1




                      probably the easiest way here.
                      – Mohit
                      Dec 13 '16 at 13:58













                    up vote
                    48
                    down vote










                    up vote
                    48
                    down vote









                    Go to http://nodejs.org and download and run the installer.
                    It works now - for me at least.






                    share|improve this answer












                    Go to http://nodejs.org and download and run the installer.
                    It works now - for me at least.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Sep 7 '12 at 7:28









                    Spoeken

                    1,67722135




                    1,67722135












                    • Do you know by any chance how installed jode.js updates in OS/X?
                      – Dimitrios Mistriotis
                      Nov 9 '12 at 11:06










                    • Im not sure I understand what you are asking
                      – Spoeken
                      Nov 19 '12 at 14:22






                    • 1




                      Sorry for the confusion (wrote in a hurry). I have installed node.js straight from the site's download link, Current Version: v0.8.14. When say v0.8.15 gets released, will I have to download it again, will it auto-update, will it call-home and inform me? With homebrew for example I was doing a brew upgrade (so it was up to me)
                      – Dimitrios Mistriotis
                      Nov 19 '12 at 16:21






                    • 1




                      I don't think it will call home. You will have to check regularly and download the new version from their webpage i think. But im not 100% on this.
                      – Spoeken
                      Nov 21 '12 at 21:12






                    • 1




                      probably the easiest way here.
                      – Mohit
                      Dec 13 '16 at 13:58


















                    • Do you know by any chance how installed jode.js updates in OS/X?
                      – Dimitrios Mistriotis
                      Nov 9 '12 at 11:06










                    • Im not sure I understand what you are asking
                      – Spoeken
                      Nov 19 '12 at 14:22






                    • 1




                      Sorry for the confusion (wrote in a hurry). I have installed node.js straight from the site's download link, Current Version: v0.8.14. When say v0.8.15 gets released, will I have to download it again, will it auto-update, will it call-home and inform me? With homebrew for example I was doing a brew upgrade (so it was up to me)
                      – Dimitrios Mistriotis
                      Nov 19 '12 at 16:21






                    • 1




                      I don't think it will call home. You will have to check regularly and download the new version from their webpage i think. But im not 100% on this.
                      – Spoeken
                      Nov 21 '12 at 21:12






                    • 1




                      probably the easiest way here.
                      – Mohit
                      Dec 13 '16 at 13:58
















                    Do you know by any chance how installed jode.js updates in OS/X?
                    – Dimitrios Mistriotis
                    Nov 9 '12 at 11:06




                    Do you know by any chance how installed jode.js updates in OS/X?
                    – Dimitrios Mistriotis
                    Nov 9 '12 at 11:06












                    Im not sure I understand what you are asking
                    – Spoeken
                    Nov 19 '12 at 14:22




                    Im not sure I understand what you are asking
                    – Spoeken
                    Nov 19 '12 at 14:22




                    1




                    1




                    Sorry for the confusion (wrote in a hurry). I have installed node.js straight from the site's download link, Current Version: v0.8.14. When say v0.8.15 gets released, will I have to download it again, will it auto-update, will it call-home and inform me? With homebrew for example I was doing a brew upgrade (so it was up to me)
                    – Dimitrios Mistriotis
                    Nov 19 '12 at 16:21




                    Sorry for the confusion (wrote in a hurry). I have installed node.js straight from the site's download link, Current Version: v0.8.14. When say v0.8.15 gets released, will I have to download it again, will it auto-update, will it call-home and inform me? With homebrew for example I was doing a brew upgrade (so it was up to me)
                    – Dimitrios Mistriotis
                    Nov 19 '12 at 16:21




                    1




                    1




                    I don't think it will call home. You will have to check regularly and download the new version from their webpage i think. But im not 100% on this.
                    – Spoeken
                    Nov 21 '12 at 21:12




                    I don't think it will call home. You will have to check regularly and download the new version from their webpage i think. But im not 100% on this.
                    – Spoeken
                    Nov 21 '12 at 21:12




                    1




                    1




                    probably the easiest way here.
                    – Mohit
                    Dec 13 '16 at 13:58




                    probably the easiest way here.
                    – Mohit
                    Dec 13 '16 at 13:58










                    up vote
                    39
                    down vote













                    You could install nvm and have multiple versions of Node.js installed.



                    curl https://raw.github.com/creationix/nvm/master/install.sh | sh
                    source ~/.nvm/nvm.sh


                    and then run:



                    nvm install 0.8.22  #(or whatever version of Node.js you want)


                    you can see what versions you have installed with :



                    nvm list


                    and you can change between versions with:



                    nvm use 0.8.22


                    The great thing about using NVM is that you can test different versions alongside one another. If different apps require different versions of Node.js, you can run them both.






                    share|improve this answer

















                    • 2




                      I am using this method now. It seems to me that this is the best way to keep multiple versions running at the same machine.
                      – afterglowlee
                      Apr 14 '13 at 21:19















                    up vote
                    39
                    down vote













                    You could install nvm and have multiple versions of Node.js installed.



                    curl https://raw.github.com/creationix/nvm/master/install.sh | sh
                    source ~/.nvm/nvm.sh


                    and then run:



                    nvm install 0.8.22  #(or whatever version of Node.js you want)


                    you can see what versions you have installed with :



                    nvm list


                    and you can change between versions with:



                    nvm use 0.8.22


                    The great thing about using NVM is that you can test different versions alongside one another. If different apps require different versions of Node.js, you can run them both.






                    share|improve this answer

















                    • 2




                      I am using this method now. It seems to me that this is the best way to keep multiple versions running at the same machine.
                      – afterglowlee
                      Apr 14 '13 at 21:19













                    up vote
                    39
                    down vote










                    up vote
                    39
                    down vote









                    You could install nvm and have multiple versions of Node.js installed.



                    curl https://raw.github.com/creationix/nvm/master/install.sh | sh
                    source ~/.nvm/nvm.sh


                    and then run:



                    nvm install 0.8.22  #(or whatever version of Node.js you want)


                    you can see what versions you have installed with :



                    nvm list


                    and you can change between versions with:



                    nvm use 0.8.22


                    The great thing about using NVM is that you can test different versions alongside one another. If different apps require different versions of Node.js, you can run them both.






                    share|improve this answer












                    You could install nvm and have multiple versions of Node.js installed.



                    curl https://raw.github.com/creationix/nvm/master/install.sh | sh
                    source ~/.nvm/nvm.sh


                    and then run:



                    nvm install 0.8.22  #(or whatever version of Node.js you want)


                    you can see what versions you have installed with :



                    nvm list


                    and you can change between versions with:



                    nvm use 0.8.22


                    The great thing about using NVM is that you can test different versions alongside one another. If different apps require different versions of Node.js, you can run them both.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 8 '13 at 21:55









                    fijiaaron

                    2,57622826




                    2,57622826








                    • 2




                      I am using this method now. It seems to me that this is the best way to keep multiple versions running at the same machine.
                      – afterglowlee
                      Apr 14 '13 at 21:19














                    • 2




                      I am using this method now. It seems to me that this is the best way to keep multiple versions running at the same machine.
                      – afterglowlee
                      Apr 14 '13 at 21:19








                    2




                    2




                    I am using this method now. It seems to me that this is the best way to keep multiple versions running at the same machine.
                    – afterglowlee
                    Apr 14 '13 at 21:19




                    I am using this method now. It seems to me that this is the best way to keep multiple versions running at the same machine.
                    – afterglowlee
                    Apr 14 '13 at 21:19










                    up vote
                    23
                    down vote













                    I use Node version manager (called n) for it.



                    npm install -g n


                    then



                    n latest


                    OR



                    n stable





                    share|improve this answer

















                    • 1




                      LTS version n lts
                      – Sergio Rodrigues
                      Nov 14 '16 at 18:26















                    up vote
                    23
                    down vote













                    I use Node version manager (called n) for it.



                    npm install -g n


                    then



                    n latest


                    OR



                    n stable





                    share|improve this answer

















                    • 1




                      LTS version n lts
                      – Sergio Rodrigues
                      Nov 14 '16 at 18:26













                    up vote
                    23
                    down vote










                    up vote
                    23
                    down vote









                    I use Node version manager (called n) for it.



                    npm install -g n


                    then



                    n latest


                    OR



                    n stable





                    share|improve this answer












                    I use Node version manager (called n) for it.



                    npm install -g n


                    then



                    n latest


                    OR



                    n stable






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jul 22 '16 at 12:47









                    Shaikh Shahid

                    811711




                    811711








                    • 1




                      LTS version n lts
                      – Sergio Rodrigues
                      Nov 14 '16 at 18:26














                    • 1




                      LTS version n lts
                      – Sergio Rodrigues
                      Nov 14 '16 at 18:26








                    1




                    1




                    LTS version n lts
                    – Sergio Rodrigues
                    Nov 14 '16 at 18:26




                    LTS version n lts
                    – Sergio Rodrigues
                    Nov 14 '16 at 18:26










                    up vote
                    23
                    down vote













                    Simply go to node JS Website and install the latest version.




                    Do install latest version instead of the recommended stable version. It will give you freedom to use latest ES6 Features on node.




                    Can be Found here Node JS.



                    also to update npm, you will have to use this command.



                    sudo npm i -g npm@latest




                    All your projects will work fine.






                    Other option for mac :: brew update && brew install node && npm -g npm






                    share|improve this answer



























                      up vote
                      23
                      down vote













                      Simply go to node JS Website and install the latest version.




                      Do install latest version instead of the recommended stable version. It will give you freedom to use latest ES6 Features on node.




                      Can be Found here Node JS.



                      also to update npm, you will have to use this command.



                      sudo npm i -g npm@latest




                      All your projects will work fine.






                      Other option for mac :: brew update && brew install node && npm -g npm






                      share|improve this answer

























                        up vote
                        23
                        down vote










                        up vote
                        23
                        down vote









                        Simply go to node JS Website and install the latest version.




                        Do install latest version instead of the recommended stable version. It will give you freedom to use latest ES6 Features on node.




                        Can be Found here Node JS.



                        also to update npm, you will have to use this command.



                        sudo npm i -g npm@latest




                        All your projects will work fine.






                        Other option for mac :: brew update && brew install node && npm -g npm






                        share|improve this answer














                        Simply go to node JS Website and install the latest version.




                        Do install latest version instead of the recommended stable version. It will give you freedom to use latest ES6 Features on node.




                        Can be Found here Node JS.



                        also to update npm, you will have to use this command.



                        sudo npm i -g npm@latest




                        All your projects will work fine.






                        Other option for mac :: brew update && brew install node && npm -g npm







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Jan 29 at 19:45









                        FurkanO

                        2,80211125




                        2,80211125










                        answered Oct 11 '16 at 14:03









                        Tarandeep Singh

                        694811




                        694811






















                            up vote
                            19
                            down vote













                            On macOS the homebrew recommended way is to run



                            brew install node
                            npm install -g npm@latest


                            Screenshot of Terminal Commands






                            share|improve this answer























                            • why is this the correct way?
                              – SuperUberDuper
                              Feb 24 '15 at 15:09






                            • 1




                              It will install the truly latest version, not just the most current brewed version.
                              – Nick Woodhams
                              Feb 24 '15 at 21:45















                            up vote
                            19
                            down vote













                            On macOS the homebrew recommended way is to run



                            brew install node
                            npm install -g npm@latest


                            Screenshot of Terminal Commands






                            share|improve this answer























                            • why is this the correct way?
                              – SuperUberDuper
                              Feb 24 '15 at 15:09






                            • 1




                              It will install the truly latest version, not just the most current brewed version.
                              – Nick Woodhams
                              Feb 24 '15 at 21:45













                            up vote
                            19
                            down vote










                            up vote
                            19
                            down vote









                            On macOS the homebrew recommended way is to run



                            brew install node
                            npm install -g npm@latest


                            Screenshot of Terminal Commands






                            share|improve this answer














                            On macOS the homebrew recommended way is to run



                            brew install node
                            npm install -g npm@latest


                            Screenshot of Terminal Commands







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Dec 31 '16 at 18:34

























                            answered Jan 6 '15 at 7:14









                            Nick Woodhams

                            6,46694048




                            6,46694048












                            • why is this the correct way?
                              – SuperUberDuper
                              Feb 24 '15 at 15:09






                            • 1




                              It will install the truly latest version, not just the most current brewed version.
                              – Nick Woodhams
                              Feb 24 '15 at 21:45


















                            • why is this the correct way?
                              – SuperUberDuper
                              Feb 24 '15 at 15:09






                            • 1




                              It will install the truly latest version, not just the most current brewed version.
                              – Nick Woodhams
                              Feb 24 '15 at 21:45
















                            why is this the correct way?
                            – SuperUberDuper
                            Feb 24 '15 at 15:09




                            why is this the correct way?
                            – SuperUberDuper
                            Feb 24 '15 at 15:09




                            1




                            1




                            It will install the truly latest version, not just the most current brewed version.
                            – Nick Woodhams
                            Feb 24 '15 at 21:45




                            It will install the truly latest version, not just the most current brewed version.
                            – Nick Woodhams
                            Feb 24 '15 at 21:45










                            up vote
                            10
                            down vote













                            I am able to upgrade the node using following command



                            nvm install node --reinstall-packages-from=node





                            share|improve this answer





















                            • This one worked for me. Thanks!
                              – Khom Nazid
                              Jul 22 at 14:43















                            up vote
                            10
                            down vote













                            I am able to upgrade the node using following command



                            nvm install node --reinstall-packages-from=node





                            share|improve this answer





















                            • This one worked for me. Thanks!
                              – Khom Nazid
                              Jul 22 at 14:43













                            up vote
                            10
                            down vote










                            up vote
                            10
                            down vote









                            I am able to upgrade the node using following command



                            nvm install node --reinstall-packages-from=node





                            share|improve this answer












                            I am able to upgrade the node using following command



                            nvm install node --reinstall-packages-from=node






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered May 30 '17 at 10:03









                            Rohit

                            790824




                            790824












                            • This one worked for me. Thanks!
                              – Khom Nazid
                              Jul 22 at 14:43


















                            • This one worked for me. Thanks!
                              – Khom Nazid
                              Jul 22 at 14:43
















                            This one worked for me. Thanks!
                            – Khom Nazid
                            Jul 22 at 14:43




                            This one worked for me. Thanks!
                            – Khom Nazid
                            Jul 22 at 14:43










                            up vote
                            7
                            down vote













                            sadly, n doesn't worked for me. I use node version manager or nvm and it works like a charm. heres the link on how to install nvm: https://github.com/creationix/nvm#installation





                            • nvm i 8.11.2 upgrade to latest LTS


                            • nvm use 8.11.2 use it


                            • node -v check your latest version






                            share|improve this answer

















                            • 1




                              This is the one that worked for me. I tried several of the top comments, but after following the steps, node is still stuck at v6. Thanks!
                              – Geraldine Golong
                              Jul 4 at 7:25















                            up vote
                            7
                            down vote













                            sadly, n doesn't worked for me. I use node version manager or nvm and it works like a charm. heres the link on how to install nvm: https://github.com/creationix/nvm#installation





                            • nvm i 8.11.2 upgrade to latest LTS


                            • nvm use 8.11.2 use it


                            • node -v check your latest version






                            share|improve this answer

















                            • 1




                              This is the one that worked for me. I tried several of the top comments, but after following the steps, node is still stuck at v6. Thanks!
                              – Geraldine Golong
                              Jul 4 at 7:25













                            up vote
                            7
                            down vote










                            up vote
                            7
                            down vote









                            sadly, n doesn't worked for me. I use node version manager or nvm and it works like a charm. heres the link on how to install nvm: https://github.com/creationix/nvm#installation





                            • nvm i 8.11.2 upgrade to latest LTS


                            • nvm use 8.11.2 use it


                            • node -v check your latest version






                            share|improve this answer












                            sadly, n doesn't worked for me. I use node version manager or nvm and it works like a charm. heres the link on how to install nvm: https://github.com/creationix/nvm#installation





                            • nvm i 8.11.2 upgrade to latest LTS


                            • nvm use 8.11.2 use it


                            • node -v check your latest version







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jun 1 at 2:47









                            Jannomeister

                            374214




                            374214








                            • 1




                              This is the one that worked for me. I tried several of the top comments, but after following the steps, node is still stuck at v6. Thanks!
                              – Geraldine Golong
                              Jul 4 at 7:25














                            • 1




                              This is the one that worked for me. I tried several of the top comments, but after following the steps, node is still stuck at v6. Thanks!
                              – Geraldine Golong
                              Jul 4 at 7:25








                            1




                            1




                            This is the one that worked for me. I tried several of the top comments, but after following the steps, node is still stuck at v6. Thanks!
                            – Geraldine Golong
                            Jul 4 at 7:25




                            This is the one that worked for me. I tried several of the top comments, but after following the steps, node is still stuck at v6. Thanks!
                            – Geraldine Golong
                            Jul 4 at 7:25










                            up vote
                            6
                            down vote













                            Go to the website nodejs.org and download the latest pkg then install.
                            it works for me



                            I used brew to upgrade my node. It has installed but it located in /usr/local/Cellar/node/5.5.0 and there is a default node in /usr/local/bin/node which bothers me. I don't want to make soft link because I don't really know how brew is organized.
                            So I download the pkg file, installed and I got this info:



                            Node.js was installed at



                            /usr/local/bin/node


                            npm was installed at



                            /usr/local/bin/npm


                            Make sure that /usr/local/bin is in your $PATH.



                            Now the upgrade is completed






                            share|improve this answer



























                              up vote
                              6
                              down vote













                              Go to the website nodejs.org and download the latest pkg then install.
                              it works for me



                              I used brew to upgrade my node. It has installed but it located in /usr/local/Cellar/node/5.5.0 and there is a default node in /usr/local/bin/node which bothers me. I don't want to make soft link because I don't really know how brew is organized.
                              So I download the pkg file, installed and I got this info:



                              Node.js was installed at



                              /usr/local/bin/node


                              npm was installed at



                              /usr/local/bin/npm


                              Make sure that /usr/local/bin is in your $PATH.



                              Now the upgrade is completed






                              share|improve this answer

























                                up vote
                                6
                                down vote










                                up vote
                                6
                                down vote









                                Go to the website nodejs.org and download the latest pkg then install.
                                it works for me



                                I used brew to upgrade my node. It has installed but it located in /usr/local/Cellar/node/5.5.0 and there is a default node in /usr/local/bin/node which bothers me. I don't want to make soft link because I don't really know how brew is organized.
                                So I download the pkg file, installed and I got this info:



                                Node.js was installed at



                                /usr/local/bin/node


                                npm was installed at



                                /usr/local/bin/npm


                                Make sure that /usr/local/bin is in your $PATH.



                                Now the upgrade is completed






                                share|improve this answer














                                Go to the website nodejs.org and download the latest pkg then install.
                                it works for me



                                I used brew to upgrade my node. It has installed but it located in /usr/local/Cellar/node/5.5.0 and there is a default node in /usr/local/bin/node which bothers me. I don't want to make soft link because I don't really know how brew is organized.
                                So I download the pkg file, installed and I got this info:



                                Node.js was installed at



                                /usr/local/bin/node


                                npm was installed at



                                /usr/local/bin/npm


                                Make sure that /usr/local/bin is in your $PATH.



                                Now the upgrade is completed







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Sep 28 '16 at 16:54









                                iSkore

                                4,10131841




                                4,10131841










                                answered Apr 19 '16 at 8:37









                                Lucas Liu

                                25537




                                25537






















                                    up vote
                                    5
                                    down vote













                                    You can just go to nodejs.org and download the newest package. It will update appropriately for you. NPM will be updated as well.






                                    share|improve this answer

















                                    • 2




                                      By far the easiest, if you initially installed it via de the website.
                                      – Elwin
                                      Jun 8 '16 at 11:27















                                    up vote
                                    5
                                    down vote













                                    You can just go to nodejs.org and download the newest package. It will update appropriately for you. NPM will be updated as well.






                                    share|improve this answer

















                                    • 2




                                      By far the easiest, if you initially installed it via de the website.
                                      – Elwin
                                      Jun 8 '16 at 11:27













                                    up vote
                                    5
                                    down vote










                                    up vote
                                    5
                                    down vote









                                    You can just go to nodejs.org and download the newest package. It will update appropriately for you. NPM will be updated as well.






                                    share|improve this answer












                                    You can just go to nodejs.org and download the newest package. It will update appropriately for you. NPM will be updated as well.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Apr 4 '16 at 5:06









                                    BRogers

                                    2,68441525




                                    2,68441525








                                    • 2




                                      By far the easiest, if you initially installed it via de the website.
                                      – Elwin
                                      Jun 8 '16 at 11:27














                                    • 2




                                      By far the easiest, if you initially installed it via de the website.
                                      – Elwin
                                      Jun 8 '16 at 11:27








                                    2




                                    2




                                    By far the easiest, if you initially installed it via de the website.
                                    – Elwin
                                    Jun 8 '16 at 11:27




                                    By far the easiest, if you initially installed it via de the website.
                                    – Elwin
                                    Jun 8 '16 at 11:27










                                    up vote
                                    3
                                    down vote













                                    You can run but you can't hide... At the end you will be using NVM anyways.






                                    share|improve this answer

















                                    • 2




                                      Or the 'n' package... See Kenny West's answer if you'd like a simple package manager you can install via npm.
                                      – depthfirstdesigner
                                      Oct 15 '14 at 20:52















                                    up vote
                                    3
                                    down vote













                                    You can run but you can't hide... At the end you will be using NVM anyways.






                                    share|improve this answer

















                                    • 2




                                      Or the 'n' package... See Kenny West's answer if you'd like a simple package manager you can install via npm.
                                      – depthfirstdesigner
                                      Oct 15 '14 at 20:52













                                    up vote
                                    3
                                    down vote










                                    up vote
                                    3
                                    down vote









                                    You can run but you can't hide... At the end you will be using NVM anyways.






                                    share|improve this answer












                                    You can run but you can't hide... At the end you will be using NVM anyways.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Apr 15 '14 at 13:39









                                    Igor Escobar

                                    727513




                                    727513








                                    • 2




                                      Or the 'n' package... See Kenny West's answer if you'd like a simple package manager you can install via npm.
                                      – depthfirstdesigner
                                      Oct 15 '14 at 20:52














                                    • 2




                                      Or the 'n' package... See Kenny West's answer if you'd like a simple package manager you can install via npm.
                                      – depthfirstdesigner
                                      Oct 15 '14 at 20:52








                                    2




                                    2




                                    Or the 'n' package... See Kenny West's answer if you'd like a simple package manager you can install via npm.
                                    – depthfirstdesigner
                                    Oct 15 '14 at 20:52




                                    Or the 'n' package... See Kenny West's answer if you'd like a simple package manager you can install via npm.
                                    – depthfirstdesigner
                                    Oct 15 '14 at 20:52










                                    up vote
                                    3
                                    down vote













                                    I think the simplest way to use the newest version of Node.js is to get the newest Node.js pkg file in the website https://nodejs.org/en/download/current/
                                    if you want to use different version of Node.js you can use nvm or n to manage it.






                                    share|improve this answer

























                                      up vote
                                      3
                                      down vote













                                      I think the simplest way to use the newest version of Node.js is to get the newest Node.js pkg file in the website https://nodejs.org/en/download/current/
                                      if you want to use different version of Node.js you can use nvm or n to manage it.






                                      share|improve this answer























                                        up vote
                                        3
                                        down vote










                                        up vote
                                        3
                                        down vote









                                        I think the simplest way to use the newest version of Node.js is to get the newest Node.js pkg file in the website https://nodejs.org/en/download/current/
                                        if you want to use different version of Node.js you can use nvm or n to manage it.






                                        share|improve this answer












                                        I think the simplest way to use the newest version of Node.js is to get the newest Node.js pkg file in the website https://nodejs.org/en/download/current/
                                        if you want to use different version of Node.js you can use nvm or n to manage it.







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Apr 10 '17 at 12:18









                                        user4810973

                                        343




                                        343






















                                            up vote
                                            2
                                            down vote













                                            sudo npm install -g n


                                            and then



                                            sudo n latest for linux/mac users


                                            For Windows please reinstall node.






                                            share|improve this answer



























                                              up vote
                                              2
                                              down vote













                                              sudo npm install -g n


                                              and then



                                              sudo n latest for linux/mac users


                                              For Windows please reinstall node.






                                              share|improve this answer

























                                                up vote
                                                2
                                                down vote










                                                up vote
                                                2
                                                down vote









                                                sudo npm install -g n


                                                and then



                                                sudo n latest for linux/mac users


                                                For Windows please reinstall node.






                                                share|improve this answer














                                                sudo npm install -g n


                                                and then



                                                sudo n latest for linux/mac users


                                                For Windows please reinstall node.







                                                share|improve this answer














                                                share|improve this answer



                                                share|improve this answer








                                                edited Nov 30 '17 at 13:33









                                                lmiguelvargasf

                                                10.4k97699




                                                10.4k97699










                                                answered Nov 30 '17 at 13:15









                                                sumanth reddy

                                                2112




                                                2112






















                                                    up vote
                                                    2
                                                    down vote













                                                    Nvm
                                                    Nvm is a script-based node version manager. You can install it easily with a curl and bash one-liner as described in the documentation. It's also available on Homebrew.



                                                    Assuming you have successfully installed nvm. The following will install the latest version of node.



                                                     nvm install node --reinstall-packages-from=node


                                                    The last option installs all global npm packages over to your new version. This way packages like mocha and node-inspector keep working.



                                                    N
                                                    N is an npm-based node version manager. You can install it by installing first some version of node and then running npm install -g n.



                                                    Assuming you have successfully installed n. The following will install the latest version of node.



                                                    sudo n latest


                                                    Homebrew
                                                    Homebrew is one of the two popular package managers for Mac. Assuming you have previously installed node with brew install node. You can get up-to-date with formulae and upgrade to the latest Node.js version with the following.



                                                    1 brew update
                                                    2 brew upgrade node


                                                    MacPorts
                                                    MacPorts is the another package manager for Mac. The following will update the local ports tree to get access to updated versions. Then it will install the latest version of Node.js. This works even if you have previous version of the package installed.



                                                    1 sudo port selfupdate
                                                    2 sudo port install nodejs-devel





                                                    share|improve this answer





















                                                    • brew upgrade node is a breeze
                                                      – khawarizmi
                                                      Jul 20 at 15:11










                                                    • This is what worked for me on OSX. I probably had NVM installed because node -v kept giving me 6.11.1 even after commands related to n latest and so on. The brew upgrade one worked. Thanks.
                                                      – Khom Nazid
                                                      Jul 22 at 14:41















                                                    up vote
                                                    2
                                                    down vote













                                                    Nvm
                                                    Nvm is a script-based node version manager. You can install it easily with a curl and bash one-liner as described in the documentation. It's also available on Homebrew.



                                                    Assuming you have successfully installed nvm. The following will install the latest version of node.



                                                     nvm install node --reinstall-packages-from=node


                                                    The last option installs all global npm packages over to your new version. This way packages like mocha and node-inspector keep working.



                                                    N
                                                    N is an npm-based node version manager. You can install it by installing first some version of node and then running npm install -g n.



                                                    Assuming you have successfully installed n. The following will install the latest version of node.



                                                    sudo n latest


                                                    Homebrew
                                                    Homebrew is one of the two popular package managers for Mac. Assuming you have previously installed node with brew install node. You can get up-to-date with formulae and upgrade to the latest Node.js version with the following.



                                                    1 brew update
                                                    2 brew upgrade node


                                                    MacPorts
                                                    MacPorts is the another package manager for Mac. The following will update the local ports tree to get access to updated versions. Then it will install the latest version of Node.js. This works even if you have previous version of the package installed.



                                                    1 sudo port selfupdate
                                                    2 sudo port install nodejs-devel





                                                    share|improve this answer





















                                                    • brew upgrade node is a breeze
                                                      – khawarizmi
                                                      Jul 20 at 15:11










                                                    • This is what worked for me on OSX. I probably had NVM installed because node -v kept giving me 6.11.1 even after commands related to n latest and so on. The brew upgrade one worked. Thanks.
                                                      – Khom Nazid
                                                      Jul 22 at 14:41













                                                    up vote
                                                    2
                                                    down vote










                                                    up vote
                                                    2
                                                    down vote









                                                    Nvm
                                                    Nvm is a script-based node version manager. You can install it easily with a curl and bash one-liner as described in the documentation. It's also available on Homebrew.



                                                    Assuming you have successfully installed nvm. The following will install the latest version of node.



                                                     nvm install node --reinstall-packages-from=node


                                                    The last option installs all global npm packages over to your new version. This way packages like mocha and node-inspector keep working.



                                                    N
                                                    N is an npm-based node version manager. You can install it by installing first some version of node and then running npm install -g n.



                                                    Assuming you have successfully installed n. The following will install the latest version of node.



                                                    sudo n latest


                                                    Homebrew
                                                    Homebrew is one of the two popular package managers for Mac. Assuming you have previously installed node with brew install node. You can get up-to-date with formulae and upgrade to the latest Node.js version with the following.



                                                    1 brew update
                                                    2 brew upgrade node


                                                    MacPorts
                                                    MacPorts is the another package manager for Mac. The following will update the local ports tree to get access to updated versions. Then it will install the latest version of Node.js. This works even if you have previous version of the package installed.



                                                    1 sudo port selfupdate
                                                    2 sudo port install nodejs-devel





                                                    share|improve this answer












                                                    Nvm
                                                    Nvm is a script-based node version manager. You can install it easily with a curl and bash one-liner as described in the documentation. It's also available on Homebrew.



                                                    Assuming you have successfully installed nvm. The following will install the latest version of node.



                                                     nvm install node --reinstall-packages-from=node


                                                    The last option installs all global npm packages over to your new version. This way packages like mocha and node-inspector keep working.



                                                    N
                                                    N is an npm-based node version manager. You can install it by installing first some version of node and then running npm install -g n.



                                                    Assuming you have successfully installed n. The following will install the latest version of node.



                                                    sudo n latest


                                                    Homebrew
                                                    Homebrew is one of the two popular package managers for Mac. Assuming you have previously installed node with brew install node. You can get up-to-date with formulae and upgrade to the latest Node.js version with the following.



                                                    1 brew update
                                                    2 brew upgrade node


                                                    MacPorts
                                                    MacPorts is the another package manager for Mac. The following will update the local ports tree to get access to updated versions. Then it will install the latest version of Node.js. This works even if you have previous version of the package installed.



                                                    1 sudo port selfupdate
                                                    2 sudo port install nodejs-devel






                                                    share|improve this answer












                                                    share|improve this answer



                                                    share|improve this answer










                                                    answered May 23 at 11:31









                                                    Rubin bhandari

                                                    36745




                                                    36745












                                                    • brew upgrade node is a breeze
                                                      – khawarizmi
                                                      Jul 20 at 15:11










                                                    • This is what worked for me on OSX. I probably had NVM installed because node -v kept giving me 6.11.1 even after commands related to n latest and so on. The brew upgrade one worked. Thanks.
                                                      – Khom Nazid
                                                      Jul 22 at 14:41


















                                                    • brew upgrade node is a breeze
                                                      – khawarizmi
                                                      Jul 20 at 15:11










                                                    • This is what worked for me on OSX. I probably had NVM installed because node -v kept giving me 6.11.1 even after commands related to n latest and so on. The brew upgrade one worked. Thanks.
                                                      – Khom Nazid
                                                      Jul 22 at 14:41
















                                                    brew upgrade node is a breeze
                                                    – khawarizmi
                                                    Jul 20 at 15:11




                                                    brew upgrade node is a breeze
                                                    – khawarizmi
                                                    Jul 20 at 15:11












                                                    This is what worked for me on OSX. I probably had NVM installed because node -v kept giving me 6.11.1 even after commands related to n latest and so on. The brew upgrade one worked. Thanks.
                                                    – Khom Nazid
                                                    Jul 22 at 14:41




                                                    This is what worked for me on OSX. I probably had NVM installed because node -v kept giving me 6.11.1 even after commands related to n latest and so on. The brew upgrade one worked. Thanks.
                                                    – Khom Nazid
                                                    Jul 22 at 14:41










                                                    up vote
                                                    1
                                                    down vote













                                                    Use nvm to upgrade node as per the project requirement..



                                                    install nvm through homebrew..
                                                    brew update
                                                    brew install nvm
                                                    mkdir ~/.nvm
                                                    nano ~/.bash_profile



                                                    In your .bash_profile file (you may be using an other file, according to your shell), add the following :



                                                    export NVM_DIR=~/.nvm
                                                    source $(brew --prefix nvm)/nvm.sh



                                                    source ~/.bash_profile
                                                    echo $NVM_DIR






                                                    share|improve this answer

























                                                      up vote
                                                      1
                                                      down vote













                                                      Use nvm to upgrade node as per the project requirement..



                                                      install nvm through homebrew..
                                                      brew update
                                                      brew install nvm
                                                      mkdir ~/.nvm
                                                      nano ~/.bash_profile



                                                      In your .bash_profile file (you may be using an other file, according to your shell), add the following :



                                                      export NVM_DIR=~/.nvm
                                                      source $(brew --prefix nvm)/nvm.sh



                                                      source ~/.bash_profile
                                                      echo $NVM_DIR






                                                      share|improve this answer























                                                        up vote
                                                        1
                                                        down vote










                                                        up vote
                                                        1
                                                        down vote









                                                        Use nvm to upgrade node as per the project requirement..



                                                        install nvm through homebrew..
                                                        brew update
                                                        brew install nvm
                                                        mkdir ~/.nvm
                                                        nano ~/.bash_profile



                                                        In your .bash_profile file (you may be using an other file, according to your shell), add the following :



                                                        export NVM_DIR=~/.nvm
                                                        source $(brew --prefix nvm)/nvm.sh



                                                        source ~/.bash_profile
                                                        echo $NVM_DIR






                                                        share|improve this answer












                                                        Use nvm to upgrade node as per the project requirement..



                                                        install nvm through homebrew..
                                                        brew update
                                                        brew install nvm
                                                        mkdir ~/.nvm
                                                        nano ~/.bash_profile



                                                        In your .bash_profile file (you may be using an other file, according to your shell), add the following :



                                                        export NVM_DIR=~/.nvm
                                                        source $(brew --prefix nvm)/nvm.sh



                                                        source ~/.bash_profile
                                                        echo $NVM_DIR







                                                        share|improve this answer












                                                        share|improve this answer



                                                        share|improve this answer










                                                        answered Feb 5 at 5:02









                                                        radhey shyam

                                                        31737




                                                        31737






















                                                            up vote
                                                            0
                                                            down vote













                                                            These 2 methods I tried are not working:




                                                            1. Use npm


                                                            sudo npm cache clean -f



                                                            sudo npm install -g n



                                                            sudo n stable




                                                            1. Manual install node from official website (https://nodejs.org/en/)


                                                            After trying, node -v still shows the old version of node.





                                                            Below method works for me:



                                                            Step 1: Install nvm (for more details: https://github.com/creationix/nvm#installation)



                                                            Open terminal and type this command:



                                                            curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash



                                                            Close terminal and reopen it.



                                                            Type this command to check if nvm is installed:



                                                            command -v nvm



                                                            enter image description here



                                                            Step 2: To download, compile, and install the latest release of node, type this:



                                                            nvm install node ("node" is an alias for the latest version)



                                                            To check if node gets the latest version (v10.11.0).



                                                            enter image description here



                                                            Installing the latest node also installs the latest npm.



                                                            Check if npm gets the latest version (6.4.1).



                                                            enter image description here






                                                            share|improve this answer



























                                                              up vote
                                                              0
                                                              down vote













                                                              These 2 methods I tried are not working:




                                                              1. Use npm


                                                              sudo npm cache clean -f



                                                              sudo npm install -g n



                                                              sudo n stable




                                                              1. Manual install node from official website (https://nodejs.org/en/)


                                                              After trying, node -v still shows the old version of node.





                                                              Below method works for me:



                                                              Step 1: Install nvm (for more details: https://github.com/creationix/nvm#installation)



                                                              Open terminal and type this command:



                                                              curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash



                                                              Close terminal and reopen it.



                                                              Type this command to check if nvm is installed:



                                                              command -v nvm



                                                              enter image description here



                                                              Step 2: To download, compile, and install the latest release of node, type this:



                                                              nvm install node ("node" is an alias for the latest version)



                                                              To check if node gets the latest version (v10.11.0).



                                                              enter image description here



                                                              Installing the latest node also installs the latest npm.



                                                              Check if npm gets the latest version (6.4.1).



                                                              enter image description here






                                                              share|improve this answer

























                                                                up vote
                                                                0
                                                                down vote










                                                                up vote
                                                                0
                                                                down vote









                                                                These 2 methods I tried are not working:




                                                                1. Use npm


                                                                sudo npm cache clean -f



                                                                sudo npm install -g n



                                                                sudo n stable




                                                                1. Manual install node from official website (https://nodejs.org/en/)


                                                                After trying, node -v still shows the old version of node.





                                                                Below method works for me:



                                                                Step 1: Install nvm (for more details: https://github.com/creationix/nvm#installation)



                                                                Open terminal and type this command:



                                                                curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash



                                                                Close terminal and reopen it.



                                                                Type this command to check if nvm is installed:



                                                                command -v nvm



                                                                enter image description here



                                                                Step 2: To download, compile, and install the latest release of node, type this:



                                                                nvm install node ("node" is an alias for the latest version)



                                                                To check if node gets the latest version (v10.11.0).



                                                                enter image description here



                                                                Installing the latest node also installs the latest npm.



                                                                Check if npm gets the latest version (6.4.1).



                                                                enter image description here






                                                                share|improve this answer














                                                                These 2 methods I tried are not working:




                                                                1. Use npm


                                                                sudo npm cache clean -f



                                                                sudo npm install -g n



                                                                sudo n stable




                                                                1. Manual install node from official website (https://nodejs.org/en/)


                                                                After trying, node -v still shows the old version of node.





                                                                Below method works for me:



                                                                Step 1: Install nvm (for more details: https://github.com/creationix/nvm#installation)



                                                                Open terminal and type this command:



                                                                curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash



                                                                Close terminal and reopen it.



                                                                Type this command to check if nvm is installed:



                                                                command -v nvm



                                                                enter image description here



                                                                Step 2: To download, compile, and install the latest release of node, type this:



                                                                nvm install node ("node" is an alias for the latest version)



                                                                To check if node gets the latest version (v10.11.0).



                                                                enter image description here



                                                                Installing the latest node also installs the latest npm.



                                                                Check if npm gets the latest version (6.4.1).



                                                                enter image description here







                                                                share|improve this answer














                                                                share|improve this answer



                                                                share|improve this answer








                                                                edited Oct 5 at 13:17

























                                                                answered Oct 5 at 12:43









                                                                Saviah Kao

                                                                1116




                                                                1116






















                                                                    up vote
                                                                    0
                                                                    down vote













                                                                    for latest release:
                                                                    nvm install node



                                                                    specific version:
                                                                    nvm install 6.14.4



                                                                    https://github.com/creationix/nvm






                                                                    share|improve this answer

























                                                                      up vote
                                                                      0
                                                                      down vote













                                                                      for latest release:
                                                                      nvm install node



                                                                      specific version:
                                                                      nvm install 6.14.4



                                                                      https://github.com/creationix/nvm






                                                                      share|improve this answer























                                                                        up vote
                                                                        0
                                                                        down vote










                                                                        up vote
                                                                        0
                                                                        down vote









                                                                        for latest release:
                                                                        nvm install node



                                                                        specific version:
                                                                        nvm install 6.14.4



                                                                        https://github.com/creationix/nvm






                                                                        share|improve this answer












                                                                        for latest release:
                                                                        nvm install node



                                                                        specific version:
                                                                        nvm install 6.14.4



                                                                        https://github.com/creationix/nvm







                                                                        share|improve this answer












                                                                        share|improve this answer



                                                                        share|improve this answer










                                                                        answered Oct 24 at 23:41









                                                                        Deke

                                                                        1,23511121




                                                                        1,23511121






















                                                                            up vote
                                                                            0
                                                                            down vote













                                                                            I had the same problem. This is what worked for me because I downloaded and installed node.js globally from the node.js website.



                                                                            What I did was Give NVM (Node Version Manager) a try. Please do the commands in the following order in your terminal




                                                                            1. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                                                                            2. command -v nvm


                                                                            3. nvm install node


                                                                            4. node -v (to confirm the update)







                                                                            share|improve this answer

























                                                                              up vote
                                                                              0
                                                                              down vote













                                                                              I had the same problem. This is what worked for me because I downloaded and installed node.js globally from the node.js website.



                                                                              What I did was Give NVM (Node Version Manager) a try. Please do the commands in the following order in your terminal




                                                                              1. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                                                                              2. command -v nvm


                                                                              3. nvm install node


                                                                              4. node -v (to confirm the update)







                                                                              share|improve this answer























                                                                                up vote
                                                                                0
                                                                                down vote










                                                                                up vote
                                                                                0
                                                                                down vote









                                                                                I had the same problem. This is what worked for me because I downloaded and installed node.js globally from the node.js website.



                                                                                What I did was Give NVM (Node Version Manager) a try. Please do the commands in the following order in your terminal




                                                                                1. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                                                                                2. command -v nvm


                                                                                3. nvm install node


                                                                                4. node -v (to confirm the update)







                                                                                share|improve this answer












                                                                                I had the same problem. This is what worked for me because I downloaded and installed node.js globally from the node.js website.



                                                                                What I did was Give NVM (Node Version Manager) a try. Please do the commands in the following order in your terminal




                                                                                1. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash


                                                                                2. command -v nvm


                                                                                3. nvm install node


                                                                                4. node -v (to confirm the update)








                                                                                share|improve this answer












                                                                                share|improve this answer



                                                                                share|improve this answer










                                                                                answered Nov 7 at 13:44









                                                                                fypnlp

                                                                                269




                                                                                269






















                                                                                    up vote
                                                                                    -1
                                                                                    down vote













                                                                                    I was able to update in ~20 seconds with just one line of code



                                                                                    sudo n latest


                                                                                    Other commands weren't working for me, but this one worked. Hope it helps somebody.






                                                                                    share|improve this answer

























                                                                                      up vote
                                                                                      -1
                                                                                      down vote













                                                                                      I was able to update in ~20 seconds with just one line of code



                                                                                      sudo n latest


                                                                                      Other commands weren't working for me, but this one worked. Hope it helps somebody.






                                                                                      share|improve this answer























                                                                                        up vote
                                                                                        -1
                                                                                        down vote










                                                                                        up vote
                                                                                        -1
                                                                                        down vote









                                                                                        I was able to update in ~20 seconds with just one line of code



                                                                                        sudo n latest


                                                                                        Other commands weren't working for me, but this one worked. Hope it helps somebody.






                                                                                        share|improve this answer












                                                                                        I was able to update in ~20 seconds with just one line of code



                                                                                        sudo n latest


                                                                                        Other commands weren't working for me, but this one worked. Hope it helps somebody.







                                                                                        share|improve this answer












                                                                                        share|improve this answer



                                                                                        share|improve this answer










                                                                                        answered Jun 15 at 5:32









                                                                                        pihyper

                                                                                        27337




                                                                                        27337

















                                                                                            protected by Community Mar 24 at 5:47



                                                                                            Thank you for your interest in this question.
                                                                                            Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                                                                                            Would you like to answer one of these unanswered questions instead?



                                                                                            這個網誌中的熱門文章

                                                                                            Tangent Lines Diagram Along Smooth Curve

                                                                                            Yusuf al-Mu'taman ibn Hud

                                                                                            Zucchini