How to upgrade/install newest version of nodejs on Ubuntu 14.04How can I update my nodeJS to the latest version?Cannot install Fragment Image Viewer on Ubuntu 14.04Unable to reinstall unity-2d on Ubuntu 14.04 desktop LTS?Why my kernel is not the latest for 14.04?Why do I get an error trying to install php5-intl?How to install R package in ubuntu 14.04.03?Getting error to configure php5 mysql packges

50K, what to do with it?

Team members' and manager's behaviour is indifferent after I announce my intention to leave in 8 months

Did the Mueller report find that Trump committed any felonies?

Does the Detect Magic spell detect itself?

Turing award papers

Why does UNIX ed not have a prompt by default

In Germany, why does the burden of proof fall on authorities rather than the company or individual when it comes to possible illegal funds?

Why couldn't Rick just use a micro sun to power his car?

How to pay less tax on a high salary?

Is it harder to enter an atmosphere perpendicular or at an angle

Professor Pun's Personal Project

Density plot on the surface of a sphere

Want to published unpublished work found in an auction storage unit

Round up my number

How to replace all elements of a list by a rule "element" -> "element_"

What visual cues distinguish the different floors on The Big Bang Theory?

Why try to impeach Trump now?

Travelling to Paris by train during strike in December 2019

Does a patron have to know their warlock?

Feeling of forcing oneself to do something

Do insurance rates depend on credit scores?

Is there a material or method to allow "swimmable" coins?

Is 4.5 hours between flights enough time to get from LHR to LGW?

Is Irish buttermilk different



How to upgrade/install newest version of nodejs on Ubuntu 14.04


How can I update my nodeJS to the latest version?Cannot install Fragment Image Viewer on Ubuntu 14.04Unable to reinstall unity-2d on Ubuntu 14.04 desktop LTS?Why my kernel is not the latest for 14.04?Why do I get an error trying to install php5-intl?How to install R package in ubuntu 14.04.03?Getting error to configure php5 mysql packges






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0


















I have been working an hour for this.



Taken from their official documentation :



curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs


However, its never working for me. I have tried to clear the npm cache, even uninstall it and run both command again. Its still not working. I keep getting version 0.10.25



I run :



grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/* 


And this is what i get :



deb http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://id.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty universe
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
deb http://ppa.launchpad.net/cpug-devs/ppa/ubuntu saucy main
deb http://ppa.launchpad.net/cwchien/gradle/ubuntu saucy main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.8/ubuntu trusty main
deb http://linux.dropbox.com/ubuntu saucy main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu saucy main
deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main


It seems the nodejs is not on the list.



What should i do? Please kindly help me










share|improve this question































    0


















    I have been working an hour for this.



    Taken from their official documentation :



    curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
    sudo apt-get install -y nodejs


    However, its never working for me. I have tried to clear the npm cache, even uninstall it and run both command again. Its still not working. I keep getting version 0.10.25



    I run :



    grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/* 


    And this is what i get :



    deb http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
    deb-src http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
    deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
    deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
    deb http://id.archive.ubuntu.com/ubuntu/ trusty universe
    deb-src http://id.archive.ubuntu.com/ubuntu/ trusty universe
    deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
    deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
    deb http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
    deb-src http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
    deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
    deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
    deb http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
    deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
    deb http://security.ubuntu.com/ubuntu trusty-security main restricted
    deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
    deb http://security.ubuntu.com/ubuntu trusty-security universe
    deb-src http://security.ubuntu.com/ubuntu trusty-security universe
    deb http://security.ubuntu.com/ubuntu trusty-security multiverse
    deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
    deb http://extras.ubuntu.com/ubuntu trusty main
    deb-src http://extras.ubuntu.com/ubuntu trusty main
    deb http://ppa.launchpad.net/cpug-devs/ppa/ubuntu saucy main
    deb http://ppa.launchpad.net/cwchien/gradle/ubuntu saucy main
    deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
    deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
    deb http://ppa.launchpad.net/dominik-stadler/subversion-1.8/ubuntu trusty main
    deb http://linux.dropbox.com/ubuntu saucy main
    deb http://dl.google.com/linux/chrome/deb/ stable main
    deb http://dl.google.com/linux/chrome/deb/ stable main
    deb http://dl.google.com/linux/chrome/deb/ stable main
    deb http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu saucy main
    deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
    deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
    deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
    deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
    deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
    deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
    deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
    deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main


    It seems the nodejs is not on the list.



    What should i do? Please kindly help me










    share|improve this question



























      0













      0









      0








      I have been working an hour for this.



      Taken from their official documentation :



      curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
      sudo apt-get install -y nodejs


      However, its never working for me. I have tried to clear the npm cache, even uninstall it and run both command again. Its still not working. I keep getting version 0.10.25



      I run :



      grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/* 


      And this is what i get :



      deb http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
      deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
      deb http://id.archive.ubuntu.com/ubuntu/ trusty universe
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty universe
      deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
      deb http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
      deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
      deb http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
      deb http://security.ubuntu.com/ubuntu trusty-security main restricted
      deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
      deb http://security.ubuntu.com/ubuntu trusty-security universe
      deb-src http://security.ubuntu.com/ubuntu trusty-security universe
      deb http://security.ubuntu.com/ubuntu trusty-security multiverse
      deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
      deb http://extras.ubuntu.com/ubuntu trusty main
      deb-src http://extras.ubuntu.com/ubuntu trusty main
      deb http://ppa.launchpad.net/cpug-devs/ppa/ubuntu saucy main
      deb http://ppa.launchpad.net/cwchien/gradle/ubuntu saucy main
      deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
      deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
      deb http://ppa.launchpad.net/dominik-stadler/subversion-1.8/ubuntu trusty main
      deb http://linux.dropbox.com/ubuntu saucy main
      deb http://dl.google.com/linux/chrome/deb/ stable main
      deb http://dl.google.com/linux/chrome/deb/ stable main
      deb http://dl.google.com/linux/chrome/deb/ stable main
      deb http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu saucy main
      deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
      deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
      deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
      deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
      deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
      deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
      deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
      deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main


      It seems the nodejs is not on the list.



      What should i do? Please kindly help me










      share|improve this question














      I have been working an hour for this.



      Taken from their official documentation :



      curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
      sudo apt-get install -y nodejs


      However, its never working for me. I have tried to clear the npm cache, even uninstall it and run both command again. Its still not working. I keep getting version 0.10.25



      I run :



      grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/* 


      And this is what i get :



      deb http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
      deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
      deb http://id.archive.ubuntu.com/ubuntu/ trusty universe
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty universe
      deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
      deb http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
      deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
      deb http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
      deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
      deb http://security.ubuntu.com/ubuntu trusty-security main restricted
      deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
      deb http://security.ubuntu.com/ubuntu trusty-security universe
      deb-src http://security.ubuntu.com/ubuntu trusty-security universe
      deb http://security.ubuntu.com/ubuntu trusty-security multiverse
      deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
      deb http://extras.ubuntu.com/ubuntu trusty main
      deb-src http://extras.ubuntu.com/ubuntu trusty main
      deb http://ppa.launchpad.net/cpug-devs/ppa/ubuntu saucy main
      deb http://ppa.launchpad.net/cwchien/gradle/ubuntu saucy main
      deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
      deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
      deb http://ppa.launchpad.net/dominik-stadler/subversion-1.8/ubuntu trusty main
      deb http://linux.dropbox.com/ubuntu saucy main
      deb http://dl.google.com/linux/chrome/deb/ stable main
      deb http://dl.google.com/linux/chrome/deb/ stable main
      deb http://dl.google.com/linux/chrome/deb/ stable main
      deb http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu saucy main
      deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
      deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
      deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
      deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
      deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
      deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
      deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
      deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main


      It seems the nodejs is not on the list.



      What should i do? Please kindly help me







      14.04 nodejs curl






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 '15 at 15:42









      Blaze TamaBlaze Tama

      6165 gold badges15 silver badges26 bronze badges




      6165 gold badges15 silver badges26 bronze badges























          2 Answers
          2






          active

          oldest

          votes


















          0



















          Below are the steps to install Node.js from source (OSX/linux)



          NOTE - this installs Node.js which gives you both node as well as npm, they come together per release.



          to start fresh remove prior node and npm installs as well as these :



          sudo mv ~/.npmrc ~/.npmrc_ignore
          sudo mv ~/.npm ~/.npm_ignore
          sudo mv ~/tmp ~/tmp_ignore
          sudo mv ~/.npm-init.js ~/.npm-init.js_ignore


          download source from : http://nodejs.org/download/



          cd node-v5.0.0 # <-- or whatever download expands to


          You may/should issue all following cmds as yourself NOT root (sudo)



          Pick one of these NODE_PARENT locations to define where node gets installed into :



          # export NODE_PARENT=/some/desired/install/path_goes_here
          # export NODE_PARENT=/usr/local/bin/nodejs # use this ONLY if you MUST install as root (sudo)
          export NODE_PARENT=$HOME/node-v5.0.0 # Recommended - owned by you NOT root

          export PATH=$NODE_PARENT/bin:$PATH # jack up PATH for executables
          export NODE_PATH=$NODE_PARENT/lib/node_modules # so node itself can find its modules dir


          ./configure --prefix=$NODE_PARENT



          make
          make install


          which puts it into dir defined by above --prefix



          when you use syntax : npm install -g some_cool_module the -g for global installs it into dir $NODE_PATH and not your $PWD



          IMPORTANT - put above three export xxx=yyy commands into your ~/.bashrc or some such to persist these environment variable changes



          On subsequent updates to Nodejs, just update your ~/.bashrc with new release name in your NODE_PARENT env var , then source this ~/.bashrc and simply issue the configure/make/install as above



          If you had a prior install of node you may want to copy over previously installed modules into new location :



          ~/node-v5.0.0/lib/node_modules/


          or do fresh module installs using npm install -g xxxx






          share|improve this answer
































            0



















            I finally used the unofficial/outdated way :



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

            sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node


            Taken from :



            How can I update my nodeJS to the latest version?



            However this make my node -v and my nodejs -v have different version. The nodejs -v still return outdated version. I dont know if this have any effect yet.






            share|improve this answer




























              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "89"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );














              draft saved

              draft discarded
















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f695138%2fhow-to-upgrade-install-newest-version-of-nodejs-on-ubuntu-14-04%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown


























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0



















              Below are the steps to install Node.js from source (OSX/linux)



              NOTE - this installs Node.js which gives you both node as well as npm, they come together per release.



              to start fresh remove prior node and npm installs as well as these :



              sudo mv ~/.npmrc ~/.npmrc_ignore
              sudo mv ~/.npm ~/.npm_ignore
              sudo mv ~/tmp ~/tmp_ignore
              sudo mv ~/.npm-init.js ~/.npm-init.js_ignore


              download source from : http://nodejs.org/download/



              cd node-v5.0.0 # <-- or whatever download expands to


              You may/should issue all following cmds as yourself NOT root (sudo)



              Pick one of these NODE_PARENT locations to define where node gets installed into :



              # export NODE_PARENT=/some/desired/install/path_goes_here
              # export NODE_PARENT=/usr/local/bin/nodejs # use this ONLY if you MUST install as root (sudo)
              export NODE_PARENT=$HOME/node-v5.0.0 # Recommended - owned by you NOT root

              export PATH=$NODE_PARENT/bin:$PATH # jack up PATH for executables
              export NODE_PATH=$NODE_PARENT/lib/node_modules # so node itself can find its modules dir


              ./configure --prefix=$NODE_PARENT



              make
              make install


              which puts it into dir defined by above --prefix



              when you use syntax : npm install -g some_cool_module the -g for global installs it into dir $NODE_PATH and not your $PWD



              IMPORTANT - put above three export xxx=yyy commands into your ~/.bashrc or some such to persist these environment variable changes



              On subsequent updates to Nodejs, just update your ~/.bashrc with new release name in your NODE_PARENT env var , then source this ~/.bashrc and simply issue the configure/make/install as above



              If you had a prior install of node you may want to copy over previously installed modules into new location :



              ~/node-v5.0.0/lib/node_modules/


              or do fresh module installs using npm install -g xxxx






              share|improve this answer





























                0



















                Below are the steps to install Node.js from source (OSX/linux)



                NOTE - this installs Node.js which gives you both node as well as npm, they come together per release.



                to start fresh remove prior node and npm installs as well as these :



                sudo mv ~/.npmrc ~/.npmrc_ignore
                sudo mv ~/.npm ~/.npm_ignore
                sudo mv ~/tmp ~/tmp_ignore
                sudo mv ~/.npm-init.js ~/.npm-init.js_ignore


                download source from : http://nodejs.org/download/



                cd node-v5.0.0 # <-- or whatever download expands to


                You may/should issue all following cmds as yourself NOT root (sudo)



                Pick one of these NODE_PARENT locations to define where node gets installed into :



                # export NODE_PARENT=/some/desired/install/path_goes_here
                # export NODE_PARENT=/usr/local/bin/nodejs # use this ONLY if you MUST install as root (sudo)
                export NODE_PARENT=$HOME/node-v5.0.0 # Recommended - owned by you NOT root

                export PATH=$NODE_PARENT/bin:$PATH # jack up PATH for executables
                export NODE_PATH=$NODE_PARENT/lib/node_modules # so node itself can find its modules dir


                ./configure --prefix=$NODE_PARENT



                make
                make install


                which puts it into dir defined by above --prefix



                when you use syntax : npm install -g some_cool_module the -g for global installs it into dir $NODE_PATH and not your $PWD



                IMPORTANT - put above three export xxx=yyy commands into your ~/.bashrc or some such to persist these environment variable changes



                On subsequent updates to Nodejs, just update your ~/.bashrc with new release name in your NODE_PARENT env var , then source this ~/.bashrc and simply issue the configure/make/install as above



                If you had a prior install of node you may want to copy over previously installed modules into new location :



                ~/node-v5.0.0/lib/node_modules/


                or do fresh module installs using npm install -g xxxx






                share|improve this answer



























                  0















                  0











                  0









                  Below are the steps to install Node.js from source (OSX/linux)



                  NOTE - this installs Node.js which gives you both node as well as npm, they come together per release.



                  to start fresh remove prior node and npm installs as well as these :



                  sudo mv ~/.npmrc ~/.npmrc_ignore
                  sudo mv ~/.npm ~/.npm_ignore
                  sudo mv ~/tmp ~/tmp_ignore
                  sudo mv ~/.npm-init.js ~/.npm-init.js_ignore


                  download source from : http://nodejs.org/download/



                  cd node-v5.0.0 # <-- or whatever download expands to


                  You may/should issue all following cmds as yourself NOT root (sudo)



                  Pick one of these NODE_PARENT locations to define where node gets installed into :



                  # export NODE_PARENT=/some/desired/install/path_goes_here
                  # export NODE_PARENT=/usr/local/bin/nodejs # use this ONLY if you MUST install as root (sudo)
                  export NODE_PARENT=$HOME/node-v5.0.0 # Recommended - owned by you NOT root

                  export PATH=$NODE_PARENT/bin:$PATH # jack up PATH for executables
                  export NODE_PATH=$NODE_PARENT/lib/node_modules # so node itself can find its modules dir


                  ./configure --prefix=$NODE_PARENT



                  make
                  make install


                  which puts it into dir defined by above --prefix



                  when you use syntax : npm install -g some_cool_module the -g for global installs it into dir $NODE_PATH and not your $PWD



                  IMPORTANT - put above three export xxx=yyy commands into your ~/.bashrc or some such to persist these environment variable changes



                  On subsequent updates to Nodejs, just update your ~/.bashrc with new release name in your NODE_PARENT env var , then source this ~/.bashrc and simply issue the configure/make/install as above



                  If you had a prior install of node you may want to copy over previously installed modules into new location :



                  ~/node-v5.0.0/lib/node_modules/


                  or do fresh module installs using npm install -g xxxx






                  share|improve this answer














                  Below are the steps to install Node.js from source (OSX/linux)



                  NOTE - this installs Node.js which gives you both node as well as npm, they come together per release.



                  to start fresh remove prior node and npm installs as well as these :



                  sudo mv ~/.npmrc ~/.npmrc_ignore
                  sudo mv ~/.npm ~/.npm_ignore
                  sudo mv ~/tmp ~/tmp_ignore
                  sudo mv ~/.npm-init.js ~/.npm-init.js_ignore


                  download source from : http://nodejs.org/download/



                  cd node-v5.0.0 # <-- or whatever download expands to


                  You may/should issue all following cmds as yourself NOT root (sudo)



                  Pick one of these NODE_PARENT locations to define where node gets installed into :



                  # export NODE_PARENT=/some/desired/install/path_goes_here
                  # export NODE_PARENT=/usr/local/bin/nodejs # use this ONLY if you MUST install as root (sudo)
                  export NODE_PARENT=$HOME/node-v5.0.0 # Recommended - owned by you NOT root

                  export PATH=$NODE_PARENT/bin:$PATH # jack up PATH for executables
                  export NODE_PATH=$NODE_PARENT/lib/node_modules # so node itself can find its modules dir


                  ./configure --prefix=$NODE_PARENT



                  make
                  make install


                  which puts it into dir defined by above --prefix



                  when you use syntax : npm install -g some_cool_module the -g for global installs it into dir $NODE_PATH and not your $PWD



                  IMPORTANT - put above three export xxx=yyy commands into your ~/.bashrc or some such to persist these environment variable changes



                  On subsequent updates to Nodejs, just update your ~/.bashrc with new release name in your NODE_PARENT env var , then source this ~/.bashrc and simply issue the configure/make/install as above



                  If you had a prior install of node you may want to copy over previously installed modules into new location :



                  ~/node-v5.0.0/lib/node_modules/


                  or do fresh module installs using npm install -g xxxx







                  share|improve this answer













                  share|improve this answer




                  share|improve this answer










                  answered Nov 7 '15 at 15:55









                  Scott StenslandScott Stensland

                  7,5676 gold badges31 silver badges49 bronze badges




                  7,5676 gold badges31 silver badges49 bronze badges


























                      0



















                      I finally used the unofficial/outdated way :



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

                      sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node


                      Taken from :



                      How can I update my nodeJS to the latest version?



                      However this make my node -v and my nodejs -v have different version. The nodejs -v still return outdated version. I dont know if this have any effect yet.






                      share|improve this answer































                        0



















                        I finally used the unofficial/outdated way :



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

                        sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node


                        Taken from :



                        How can I update my nodeJS to the latest version?



                        However this make my node -v and my nodejs -v have different version. The nodejs -v still return outdated version. I dont know if this have any effect yet.






                        share|improve this answer





























                          0















                          0











                          0









                          I finally used the unofficial/outdated way :



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

                          sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node


                          Taken from :



                          How can I update my nodeJS to the latest version?



                          However this make my node -v and my nodejs -v have different version. The nodejs -v still return outdated version. I dont know if this have any effect yet.






                          share|improve this answer
















                          I finally used the unofficial/outdated way :



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

                          sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node


                          Taken from :



                          How can I update my nodeJS to the latest version?



                          However this make my node -v and my nodejs -v have different version. The nodejs -v still return outdated version. I dont know if this have any effect yet.







                          share|improve this answer















                          share|improve this answer




                          share|improve this answer








                          edited Apr 13 '17 at 12:25









                          Community

                          1




                          1










                          answered Nov 7 '15 at 16:18









                          Blaze TamaBlaze Tama

                          6165 gold badges15 silver badges26 bronze badges




                          6165 gold badges15 silver badges26 bronze badges































                              draft saved

                              draft discarded















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f695138%2fhow-to-upgrade-install-newest-version-of-nodejs-on-ubuntu-14-04%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown









                              Popular posts from this blog

                              Tamil (spriik) Luke uk diar | Nawigatjuun

                              Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                              Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?