Nodejs always installing 4.2.6

后端 未结 5 1590
终归单人心
终归单人心 2020-12-31 10:41

I am installing latest version of nodejs in my localhost. But system is always installing the 4.2.6 version.How can i install the latest version.

Commands i have use

相关标签:
5条回答
  • 2020-12-31 10:49

    For me - the solution was on this page:

    Ref: https://websiteforstudents.com/install-the-latest-node-js-and-nmp-packages-on-ubuntu-16-04-18-04-lts/

    ... for the Latest release, add this PPA..

    curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
    

    To install the LTS release, use this PPA

    curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
    

    0 讨论(0)
  • 2020-12-31 10:50

    Hey guys if you have Ubuntu 16 try this instructions. It worked for me perfectly.Also provide your account password whenever asked in this process.

    1. sudo su -c "echo 'deb https://deb.nodesource.com/node_8.x xenial main' >> /etc/apt/sources.list.d/nodesource.list"

    2. sudo su -c "echo 'deb-src https://deb.nodesource.com/node_8.x xenial main' >> /etc/apt/sources.list.d/nodesource.list"

    3. sudo apt-get update

    4. apt-cache policy nodejs Check if the versions listed has node 8

    5. sudo apt-get install nodejs

    6. nodejs -v check the node version installed

    This shall successfully install nodejs version 8 on your system. If you wish any other version, then change the version on step 1 and 2 it shall work successfully.

    0 讨论(0)
  • 2020-12-31 11:01

    sudo rm -rf /var/lib/apt/lists/*

    sudo rm -rf /etc/apt/sources.list.d/*

    sudo apt-get update

    #Use this to remove the Previous Nodejs from Your device and then try again with Installing NVM

    0 讨论(0)
  • 2020-12-31 11:10

    In Linux/Mac systems, there is no better way than nvm - Node Version Manager.

    Install:

    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
    

    Then, usage is as simple as:

    nvm install 8.0
    nvm use 8.0
    

    If after reboot you will see old version, use nvm alias to set your version as default one.

    0 讨论(0)
  • 2020-12-31 11:16

    Current LTS instructions:

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

    Courtesy of https://github.com/nodesource/distributions#installation-instructions

    0 讨论(0)
提交回复
热议问题