Installing node on elementary os












0















Right now when I run node -v I get 4.2.6. This is after having run:



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


Elementary is an Ubuntu based distro. So I thought these directions would work.



How can I install node 6.2.0?










share|improve this question
















bumped to the homepage by Community 5 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Apart from an advice not to pipe scripts from the internet to a root shell: what does type node say? Maybe this setup_6.x thing installs to a different location and your call to node -v still runs an old version in your PATH?

    – ckujau
    May 24 '17 at 5:06













  • node is hashed (/usr/local/bin/node). Considering those directions come from https://nodejs.org/ I think its safe.

    – P.Brian.Mackey
    May 24 '17 at 11:34











  • If node is hashed to /usr/local/bin/node, then chances are my guess was correct, because often /usr/local/bin comes before /usr/bin in PATH, and the new node will be installed to /usr/bin.

    – ckujau
    May 24 '17 at 17:10


















0















Right now when I run node -v I get 4.2.6. This is after having run:



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


Elementary is an Ubuntu based distro. So I thought these directions would work.



How can I install node 6.2.0?










share|improve this question
















bumped to the homepage by Community 5 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Apart from an advice not to pipe scripts from the internet to a root shell: what does type node say? Maybe this setup_6.x thing installs to a different location and your call to node -v still runs an old version in your PATH?

    – ckujau
    May 24 '17 at 5:06













  • node is hashed (/usr/local/bin/node). Considering those directions come from https://nodejs.org/ I think its safe.

    – P.Brian.Mackey
    May 24 '17 at 11:34











  • If node is hashed to /usr/local/bin/node, then chances are my guess was correct, because often /usr/local/bin comes before /usr/bin in PATH, and the new node will be installed to /usr/bin.

    – ckujau
    May 24 '17 at 17:10
















0












0








0








Right now when I run node -v I get 4.2.6. This is after having run:



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


Elementary is an Ubuntu based distro. So I thought these directions would work.



How can I install node 6.2.0?










share|improve this question
















Right now when I run node -v I get 4.2.6. This is after having run:



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


Elementary is an Ubuntu based distro. So I thought these directions would work.



How can I install node 6.2.0?







software-installation elementary-os node.js






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 24 '17 at 3:18









Jeff Schaller

39.5k1054126




39.5k1054126










asked May 24 '17 at 2:37









P.Brian.MackeyP.Brian.Mackey

4112613




4112613





bumped to the homepage by Community 5 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 5 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Apart from an advice not to pipe scripts from the internet to a root shell: what does type node say? Maybe this setup_6.x thing installs to a different location and your call to node -v still runs an old version in your PATH?

    – ckujau
    May 24 '17 at 5:06













  • node is hashed (/usr/local/bin/node). Considering those directions come from https://nodejs.org/ I think its safe.

    – P.Brian.Mackey
    May 24 '17 at 11:34











  • If node is hashed to /usr/local/bin/node, then chances are my guess was correct, because often /usr/local/bin comes before /usr/bin in PATH, and the new node will be installed to /usr/bin.

    – ckujau
    May 24 '17 at 17:10





















  • Apart from an advice not to pipe scripts from the internet to a root shell: what does type node say? Maybe this setup_6.x thing installs to a different location and your call to node -v still runs an old version in your PATH?

    – ckujau
    May 24 '17 at 5:06













  • node is hashed (/usr/local/bin/node). Considering those directions come from https://nodejs.org/ I think its safe.

    – P.Brian.Mackey
    May 24 '17 at 11:34











  • If node is hashed to /usr/local/bin/node, then chances are my guess was correct, because often /usr/local/bin comes before /usr/bin in PATH, and the new node will be installed to /usr/bin.

    – ckujau
    May 24 '17 at 17:10



















Apart from an advice not to pipe scripts from the internet to a root shell: what does type node say? Maybe this setup_6.x thing installs to a different location and your call to node -v still runs an old version in your PATH?

– ckujau
May 24 '17 at 5:06







Apart from an advice not to pipe scripts from the internet to a root shell: what does type node say? Maybe this setup_6.x thing installs to a different location and your call to node -v still runs an old version in your PATH?

– ckujau
May 24 '17 at 5:06















node is hashed (/usr/local/bin/node). Considering those directions come from https://nodejs.org/ I think its safe.

– P.Brian.Mackey
May 24 '17 at 11:34





node is hashed (/usr/local/bin/node). Considering those directions come from https://nodejs.org/ I think its safe.

– P.Brian.Mackey
May 24 '17 at 11:34













If node is hashed to /usr/local/bin/node, then chances are my guess was correct, because often /usr/local/bin comes before /usr/bin in PATH, and the new node will be installed to /usr/bin.

– ckujau
May 24 '17 at 17:10







If node is hashed to /usr/local/bin/node, then chances are my guess was correct, because often /usr/local/bin comes before /usr/bin in PATH, and the new node will be installed to /usr/bin.

– ckujau
May 24 '17 at 17:10












1 Answer
1






active

oldest

votes


















0














I found the answer on askubuntu.



Use n module from npm in order to upgrade node



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


To upgrade to latest version (and not current stable) version, you can use



sudo n latest


To undo:



sudo apt-get install --reinstall nodejs-legacy     # fix /usr/bin/node
sudo n rm 6.0.0 # replace number with version of Node that was installed
sudo npm uninstall -g n


Found in David Walsh blog
http://davidwalsh.name/upgrade-nodejs






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    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: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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/3.0/"u003ecc by-sa 3.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%2funix.stackexchange.com%2fquestions%2f366879%2finstalling-node-on-elementary-os%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I found the answer on askubuntu.



    Use n module from npm in order to upgrade node



    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


    To upgrade to latest version (and not current stable) version, you can use



    sudo n latest


    To undo:



    sudo apt-get install --reinstall nodejs-legacy     # fix /usr/bin/node
    sudo n rm 6.0.0 # replace number with version of Node that was installed
    sudo npm uninstall -g n


    Found in David Walsh blog
    http://davidwalsh.name/upgrade-nodejs






    share|improve this answer




























      0














      I found the answer on askubuntu.



      Use n module from npm in order to upgrade node



      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


      To upgrade to latest version (and not current stable) version, you can use



      sudo n latest


      To undo:



      sudo apt-get install --reinstall nodejs-legacy     # fix /usr/bin/node
      sudo n rm 6.0.0 # replace number with version of Node that was installed
      sudo npm uninstall -g n


      Found in David Walsh blog
      http://davidwalsh.name/upgrade-nodejs






      share|improve this answer


























        0












        0








        0







        I found the answer on askubuntu.



        Use n module from npm in order to upgrade node



        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


        To upgrade to latest version (and not current stable) version, you can use



        sudo n latest


        To undo:



        sudo apt-get install --reinstall nodejs-legacy     # fix /usr/bin/node
        sudo n rm 6.0.0 # replace number with version of Node that was installed
        sudo npm uninstall -g n


        Found in David Walsh blog
        http://davidwalsh.name/upgrade-nodejs






        share|improve this answer













        I found the answer on askubuntu.



        Use n module from npm in order to upgrade node



        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


        To upgrade to latest version (and not current stable) version, you can use



        sudo n latest


        To undo:



        sudo apt-get install --reinstall nodejs-legacy     # fix /usr/bin/node
        sudo n rm 6.0.0 # replace number with version of Node that was installed
        sudo npm uninstall -g n


        Found in David Walsh blog
        http://davidwalsh.name/upgrade-nodejs







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 24 '17 at 14:54









        P.Brian.MackeyP.Brian.Mackey

        4112613




        4112613






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • 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%2funix.stackexchange.com%2fquestions%2f366879%2finstalling-node-on-elementary-os%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

            サソリ

            広島県道265号伴広島線

            Setup Asymptote in Texstudio