Install node.js on dedicated server via ssh

5.1k Views Asked by At

I own a dedicated linux server from 1&1. I have SFTP and SSH access. I would like to know if it is possible to install node.js on my server.

I already tried to install it one week ago but I failed. The downloading and extraction worked, so the folder is on my server. I did :

cd ~
wget http://nodejs.org/dist/latest/node-v11.1.0.tar.gz
tar xvf node-v11.1.0.tar.gz
mv node-v11.1.0 nodejs

But this part failed :

cp nodejs/bin/node ~/bin
cd ~/bin
ln -s ../nodejs/lib/node_modules/npm/bin/npm-cli.js npm

On the first instruction, there is an error : cp : cannot stat 'nodejs/bin/node': No such file or directory

I tried this too :

cd nodejs
./configure
make
make install

(All instructions are from tutorials)

2

There are 2 best solutions below

0
On BEST ANSWER

The instructions are you following are for a precompiled bundle for Linux.

http://nodejs.org/dist/latest/node-v11.1.0.tar.gz is the URL to a source code bundle.

Download the compiled bundle for your system instead.

0
On

Your best bet may be to look for distribution-specific instructions. Most modern package managers will have an install option for Node and there are great options 3rd parties like Nodesource as well.

For instance, here's a DO howto for installing on Ubuntu 18.04. It lists 3 different methods for install, each of which would work from an SSH session.

If you let us know what distribution and version you are running, we may be able to help you more specifically.

If you don't know, you can try one of these commands to check:

$ hostnamectl

or

$ less /etc/issue