Welcome!

The kernel problem with recent updates has been solved. Find the solution here

Important information
-- Required MX 15/16 Repository Changes
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- Introducing our new Website
-- MX Linux on social media: here

Current releases
-- MX-18.3 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.4.1 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

User avatar
Moltke
Forum Regular
Forum Regular
Posts: 198
Joined: Tue Dec 19, 2017 6:07 pm

Re: How to install LTS Nodejs

#31

Post by Moltke » Mon Feb 11, 2019 11:52 am

Stevo wrote:
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.
I know this is an old thread but since I was looking for how to install node.js in MX I found it and just wanted to add that

Code: Select all

sudo ./setup_version_number.x
didn't work for me but

Code: Select all

sudo sh ./setup_version_number.x
did.

EDIT: Well, it didn't work after all, it seemed like it'd worked but it didn't; nmp: coomand no found. So re-reading this thread I realized that node.js is in the test repo so I installed it using that and now it worked. I wanted latest which is 11 though, but guess 8 is ok too ;)
Without each other's help there ain't no hope for us :happy:

User avatar
Akizor
Forum Novice
Forum  Novice
Posts: 1
Joined: Thu Mar 14, 2019 12:36 pm

Re: How to install LTS Nodejs

#32

Post by Akizor » Thu Mar 14, 2019 12:46 pm

If anyone still don't get the installation done, here's what work for me

Code: Select all

curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -

Code: Select all

VERSION=node_11.x

Code: Select all

DISTRO=stretch
I am using Continuum, built from debian stretch, so Distro=stretch.

After that, check it using echo command

Code: Select all

echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list

Code: Select all

echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
After that, you should be able to run the following,

Code: Select all

sudo apt-get update

Code: Select all

sudo apt-get install nodejs
It worked for me, hope this can help someone. Thank you !

User avatar
yosef
Forum Novice
Forum  Novice
Posts: 2
Joined: Sat Apr 13, 2019 2:08 pm

Re: How to install LTS Nodejs

#33

Post by yosef » Sat Apr 13, 2019 2:43 pm

you should go to install it via "binary archive" :
the guide is here :

https://github.com/nodejs/help/wiki/Installation

i wrote it more accurate :


#first of all , download the "deb" file from the home page of node to the library you there.
https://nodejs.org/en/

# Unzip the binary archive to any directory you wanna install Node, I use /usr/local/lib/nodejs
# the version today is v10.15.3 if it's not your version , correct it :

VERSION=v10.15.3
DISTRO=linux-x64
sudo mkdir -p /usr/local/lib/nodejs
sudo tar -xJvf node-$VERSION-$DISTRO.tar.xz -C /usr/local/lib/nodejs


# there is in the home directory file with the name ".profile"
# you need to add that line to the end of the file , with the correct version ( today it's v10.15.3) and distro (linux-x64)
# use for this your text editor like nano , vim etc.


export PATH=/usr/local/lib/nodejs/node-v10.15.3-linux-x64/bin:$PATH

#Refresh profile

source ~/.profile

#Test installation using

$ node -v

$ npm version

$ npx -v

#then create sudo link - write the correct version and distro.

sudo ln -s /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/node /usr/bin/node

sudo ln -s /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/npm /usr/bin/npm

sudo ln -s /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/npx /usr/bin/npx

User avatar
yosef
Forum Novice
Forum  Novice
Posts: 2
Joined: Sat Apr 13, 2019 2:08 pm

Re: How to install LTS Nodejs

#34

Post by yosef » Sat Apr 13, 2019 3:53 pm

i did a little mistake :
at the end of the profile file , it's better to add with the variables name (because if we don't , the updates wouldn't done correctly)-
so we add that :

# Nodejs
VERSION=v10.15.3
DISTRO=linux-x64
export PATH=/usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin:$PATH

Benality
Forum Novice
Forum  Novice
Posts: 5
Joined: Sun Jun 09, 2019 7:11 pm

Re: How to install LTS Nodejs

#35

Post by Benality » Mon Jun 10, 2019 11:40 am

I would suggest using LinuxBrew
https://docs.brew.sh/Homebrew-on-Linux

Then simply run

Code: Select all

brew install node
Makes it easier

User avatar
freemx
Forum Novice
Forum  Novice
Posts: 2
Joined: Wed Jun 12, 2019 6:52 am

Re: How to install LTS Nodejs

#36

Post by freemx » Tue Jun 18, 2019 3:12 pm

Thank you for this suggestion Linux Homebrew is very handy and i though it was only for iOS

So Successfully installed brew in MXlinux and it helped me a lot to start build a development environment pretty fast!
But it installs nodejs v12.4.0 by default and i don't see how to install to the LTS version through linux brew

When I followed the installation instructions from the homebrew site..

On a terminal:

Code: Select all

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

I had to make a change to the suggested instructions to add Homebrew to my env PATH in .bashrc instead of .bash_profile
in order to work every time from bash

Code: Select all

test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bashrc && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bashrc
I'm good with this version but it doesn't reply on how to use brew to install nodejs 10.16.0 LTS

Post Reply

Return to “Software / Configuration”