Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

How to install LTS Nodejs

Message
Author
User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16277
Joined: Fri Dec 15, 2006 8:07 pm

Re: How to install LTS Nodejs

#21 Post by Stevo » Tue Feb 06, 2018 2:53 pm

Well, we all were new to this at one time. You'll get used to it if you're going to be a coder.

Here's the modified script with the executable bit set for you. Just extract it in a directory, open a terminal there, and run

Code: Select all

sudo ./setup_8.x
What it does is add their repo and their key to your software sources, so if you have Debian's older node.js installed, you'll see their 8.9.4 as an upgrade.

We could probably add it as an option to our package installer, but that would need a bit of discussion.

Hmmm...maybe I can use their build format instead of Sid's to get successful packages for 8.9.4. Launching build.
Last edited by Stevo on Tue Feb 06, 2018 3:20 pm, edited 1 time in total.

bigbenaugust
Forum Novice
Forum  Novice
Posts: 47
Joined: Wed Dec 20, 2017 10:41 am

Re: How to install LTS Nodejs

#22 Post by bigbenaugust » Tue Feb 06, 2018 2:59 pm

No sorcery, just editing text.
Stepping back, the instructions at nodesource.com (https://nodesource.com/blog/installing- ... ian-linux/) say to run:

Code: Select all

sudo curl -sL https://deb.nodesource.com/setup_8.x | bash -
This downloads and runs the setup script in one line. BUT you can download it like this:

Code: Select all

curl -sL https://deb.nodesource.com/setup_8.x > ./setup_8.x
Open this setup_8.x file in any text editor you choose.
Then you can edit the little table inside of the script that says who is Debian but not reporting as such. That table starts at line 258. At the end of the table (line 281), you can add a line like this:

Code: Select all

check_alt "MX"        "Horizon" "Debian" "stretch"
This will fool the installer script into thinking that your MX machine is a Debian machine (which it is, but it doesn't report as such).

Then save the file and exit the editor.

After that, run the script:

Code: Select all

sudo ./setup_8.x
This will set up the nodesource.com repository on your machine. Once that's done, run:

Code: Select all

sudo apt update && sudo apt install nodejs
and then you will have node.js 8.x on your machine.

Ninja'd by Stevo, but here's the explanation! :)
--Ben

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16277
Joined: Fri Dec 15, 2006 8:07 pm

Re: How to install LTS Nodejs

#23 Post by Stevo » Tue Feb 06, 2018 3:49 pm

I got 8.9.4 packages to build for 64-bit MX 17, so now 32-bit and MX 15/16 packages are building...so we'll have at least one set in our test repo.

User avatar
Biofobico
Forum Novice
Forum  Novice
Posts: 24
Joined: Thu Jan 18, 2018 5:32 pm

Re: How to install LTS Nodejs

#24 Post by Biofobico » Tue Feb 06, 2018 5:41 pm

@bigbenaugust Awesome work dissecting and make it understandable.
@stevo Guess I'll wait for the repo then.

Thank you both for the help :number1:

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16277
Joined: Fri Dec 15, 2006 8:07 pm

Re: How to install LTS Nodejs

#25 Post by Stevo » Tue Feb 06, 2018 5:43 pm

They all built, so I just sent them up to the test repo. You can grab them early here until I clean out my upload gdrive: https://drive.google.com/open?id=1XHWwC ... CoiNh5J98P

User avatar
Biofobico
Forum Novice
Forum  Novice
Posts: 24
Joined: Thu Jan 18, 2018 5:32 pm

Re: How to install LTS Nodejs

#26 Post by Biofobico » Tue Feb 06, 2018 6:22 pm

Stevo wrote:They all built, so I just sent them up to the test repo. You can grab them early here until I clean out my upload gdrive: https://drive.google.com/open?id=1XHWwC ... CoiNh5J98P
Awesome! Thank you @Stevo.

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16277
Joined: Fri Dec 15, 2006 8:07 pm

Re: How to install LTS Nodejs

#27 Post by Stevo » Tue Feb 06, 2018 8:31 pm

I found this site where you can look to see what versions of a package are in a plethora of repos, including MX's. Here's what they have for nodejs...the MX test version hasn't hit it yet: https://repology.org/metapackage/nodejs/versions

bigbenaugust
Forum Novice
Forum  Novice
Posts: 47
Joined: Wed Dec 20, 2017 10:41 am

Re: How to install LTS Nodejs

#28 Post by bigbenaugust » Tue Feb 06, 2018 11:20 pm

I had to figure this out to install an Electron-based MS Teams client (we use it for work) on 32-bit MX. Figured I'd share with somebody.
--Ben

User avatar
pannet1
Forum Novice
Forum  Novice
Posts: 1
Joined: Sun Aug 26, 2018 2:38 am

Re: How to install LTS Nodejs

#29 Post by pannet1 » Wed Oct 03, 2018 11:47 pm

hi,

nodejs documentation says if i install it, i will be able to access the package manager npm. but when i installed nodejs with apt, i am not able to issue npm command.

can you please advise how to get the latest npm working in mx linux.

UPDATE: i failed to the 2 and 3 pages of this thread in the beginning since i am new to this forum. i used the setup script of nodejs

Code: Select all

curl -sL https://deb.nodesource.com/setup_8.x > ./setup_8.x
they have already added MX Linux to the setup script and hence no need to add it manually as mentioned in one of the previous post here.

Post Reply

Return to “Software / Configuration”