How to install LTS Nodejs

Message
Author
User avatar
Moltke
Posts: 229
Joined: Tue Dec 19, 2017 6:07 pm

Re: How to install LTS Nodejs

#31 Post by Moltke »

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
Posts: 1
Joined: Thu Mar 14, 2019 12:36 pm

Re: How to install LTS Nodejs

#32 Post by Akizor »

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
Posts: 2
Joined: Sat Apr 13, 2019 2:08 pm

Re: How to install LTS Nodejs

#33 Post by yosef »

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
Posts: 2
Joined: Sat Apr 13, 2019 2:08 pm

Re: How to install LTS Nodejs

#34 Post by yosef »

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
Posts: 2
Joined: Sun Jun 09, 2019 7:11 pm

Re: How to install LTS Nodejs

#35 Post by Benality »

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
Posts: 1
Joined: Wed Jun 12, 2019 6:52 am

Re: How to install LTS Nodejs

#36 Post by freemx »

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
We Just need a way to access.

Post Reply

Return to “Software / Configuration”