简体   繁体   中英

Install node.js on dedicated server via ssh

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)

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM