Manually install the Node.js programming language and environment on a shared hosting server. In my environment, I use Xserver. Please note that the Linux distribution and major version may differ depending on the shared hosting service, which may result in different behavior.
Installation · nodejs/help Wiki
(The official installation manual code is too difficult to understand.)
Installing using a method that doesn’t require apt-get or sudo privileges. Copy and paste the following:
wget https://nodejs.org/dist/v8.11.4/node-v8.11.4-linux-x64.tar.xz # Latest version => DL: [Download | Node.js](https://nodejs.org/en/download/)
VERSION=v8.11.4 # Replace with the version of the downloaded node binary file
DISTRO=linux-x64 # Replace with the version of the downloaded node binary file
mkdir /home/$(echo $USER)/usr/local/bin/nodejs
tar -xJvf node-$VERSION-$DISTRO.tar.xz -C /home/$(echo $USER)/usr/local/bin/nodejs
mv /home/$(echo $USER)/usr/local/bin/nodejs/node-$VERSION-$DISTRO /home/$(echo $USER)/usr/local/bin/nodejs/node-$VERSION
export NODEJS_HOME=/home/$(echo $USER)/usr/local/bin/nodejs/node-$VERSION/bin # Copy to ~/.bashrc
export PATH=$NODEJS_HOME:$PATH # Copy to ~/.bashrc
node -v