Please log in to your SSH and type the commands given below, one by one:

if ! grep -qw "PATH=\$HOME/bin" ~/.bashrc ; then mkdir -p ~/bin && echo "PATH=\$HOME/bin:\$PATH" >> ~/.bashrc && source ~/.bashrc ; fi
cd && wget -q https://nodejs.org/dist/v21.1.0/node-v21.1.0-linux-x64.tar.gz
tar xf ~/node-v21.1.0-linux-x64.tar.gz --strip-components=1 -C ~/
rm -f ~/node-v21.1.0-linux-x64.tar.gz

node.js has been installed.

Was this answer helpful? 117 Users Found This Useful (170 Votes)