Page 1 of 1

How to install and configure Node.js on Debian

Posted: Thu Feb 09, 2023 11:09 am
by isscbta
Node.js is a server-side programming runtime that utilizes JavaScript. With it, developers can easily create scalable back-end operations by utilizing a language they may already know well from web development in browsers, JavaScript.

In the following steps, we will guide you through the installation process of Node.js on a Debian server that is running the myVesta Hosting Panel.

1. First you should check latest Node.js version on https://github.com/nodesource/distributions
2. Now all you have to do is run these commands in your SSH, as root:

Code: Select all

curl -sL https://deb.nodesource.com/setup_18.x > setup_18.x 
chmod +x setup_18.x
./setup_18.x
apt install -y nodejs build-essential libssl-dev
The version depends on the version you need, as mentioned in step one. Instead of 18.x, insert the desired version number.

The following are some posts related to this topic:

Re: How to install and configure Node.js on Debian

Posted: Fri Sep 01, 2023 3:41 pm
by mckaygerhard
this can be made per repository too:

Code: Select all

cat > /etc/apt/sources.list.d/nodejs.list << EOF
deb [trusted=yes] https://deb.nodesource.com/node_16.x $(lsb_release -cs) main
deb [trusted=yes] https://deb.nodesource.com/node_18.x $(lsb_release -cs) main
deb [trusted=yes] https://deb.nodesource.com/node_20.x $(lsb_release -cs) main
deb [trusted=yes] https://deb.nodesource.com/node_22.x $(lsb_release -cs) main
EOF

apt-get update
so then to install nodejs 18.17 you can just do:

Code: Select all

apt-get install nodejs=18.17*