13

On my server I have 0.10.25 "I do not need Rea's version, that is "0.10.30" which is the LTS for nodejs, however developers asking to install 4th version, after digging a little bit, I have found that 0.12 it the same nodejs merged with some other packages.

There is no package source for 0.12, I have downloaded .tar.gz files form nodejs's website, unpacked, but it does not contain any installation script, moving files manually or creating links is not the way I wish to go, what can I do?

Update:

[web01]~> nodejs -v
v0.10.25
[web01]~> apt-get install curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
curl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[web01]~> curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -
[web01]~> apt-get install -y nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nodejs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[web01]~> uname -a
Linux web01.example.lab 3.19.0-28-generic #30~14.04.1-Ubuntu SMP Tue Sep 1 09:32:55 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[web01]~> 
Edik Mkoyan
  • 349
  • 1
  • 3
  • 11

2 Answers2

14

The easiest way to install NodeJS is using the official PPA (which contain the latest version (8.X at the time of this edit).

Open a terminal (Ctrl+Alt+T) and run :

  1. Remove current NodeJS installation

    sudo apt-get purge nodejs*
    
  2. Install curl

    sudo apt-get install curl
    
  3. Install NodeJS:

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

If you absolutely need 0.12 and not 4.1.1 version, run :

  1. Install NodeJS:

    curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
    sudo apt-get install -y nodejs
    
Zanna
  • 70,465
hg8
  • 13,462
  • 2
    This will not help, see the update in question. – Edik Mkoyan Sep 23 '15 at 14:23
  • Please see my edited answer. – hg8 Sep 23 '15 at 14:34
  • Worked for me only after I changed distro name of my Ubuntu, which previously was LinuxMint. When I tried to install for the first time, I got error ## Your distribution, identified as "petra", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support. Fixed by changing distro release info as described here http://askubuntu.com/questions/115429/change-distro-name-from-system-info – gorodezkiy Dec 11 '15 at 14:29
  • You should add -E before bash at the end of the curl command... – smartmouse Jul 07 '16 at 08:45
0

For linux users the latest version for node.js can be found here

https://github.com/nodesource/distributions/blob/master/README.md

Node.js v19.x:

Using Ubuntu

curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - &&\
sudo apt-get install -y nodejs

Using Debian, as root

curl -fsSL https://deb.nodesource.com/setup_19.x | bash - &&\
apt-get install -y nodejs
Pilot6
  • 90,100
  • 91
  • 213
  • 324
api_nest
  • 101