Install latest nodejs version in ubuntu 14.04

前端 未结 13 1194
北恋
北恋 2020-12-12 13:50

This is the way I installed nodejs in ubuntu 14.04 LTS:

sudo add-apt-repository ppa:chris-lea/node.js

sudo apt-get install nodejs

When I c

相关标签:
13条回答
  • 2020-12-12 14:23
    sudo apt-get install curl
    

    For Node.js v4

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

    For Node.js v5:

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

    Node.js v6:

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

    Node.js v7:

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

    Node.js 8:

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

    https://nodejs.org/en/download/package-manager/

    0 讨论(0)
  • 2020-12-12 14:23

    This worked for me:

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

    Hope it helps someone too :)

    0 讨论(0)
  • 2020-12-12 14:25
    wget -qO- https://deb.nodesource.com/setup_X.x | sudo bash -
    sudo apt-get install -y nodejs
    
    0 讨论(0)
  • 2020-12-12 14:26

    Ubuntu 14.04 contains a version of Node.js in its default repositories that can be used to easily provide a consistent experience across multiple servers. The version in the repositories is 0.10.25. This will not be the latest version, but it should be quite stable.

    In order to get this version, we just have to use the apt package manager. We should refresh our local package index prior and then install from the repositories:

    sudo apt-get update
    sudo apt-get install nodejs
    

    If the package in the repositories suits your needs, this is all that you need to do to get set up with Node.js. In most cases, you'll also want to also install npm, which is the Node.js package manager. You can do this by typing:

    sudo apt-get install npm
    

    This will allow you to easily install modules and packages to use with Node.js.

    Because of a conflict with another package, the executable from the Ubuntu repositories is called nodejs instead of node. Keep this in mind as you are running software.

    0 讨论(0)
  • 2020-12-12 14:29

    Running Ubuntu Mate 14.04 LTS

    1. curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
    2. sudo apt-get install -y nodejs
    3. nodejs -v
    0 讨论(0)
  • 2020-12-12 14:30

    Assuming you already have npm package and want to upgrade nodejs version:

    sudo npm install -g n
    sudo n latest
    

    In case you don't have installed npm package then itstall it using following command:

    sudo apt-get install npm
    

    On linux.

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