How to install Nodejs on CentOS 7 without Internet connection with root permission? - node.js

I've recently migrated to Linux CentOS7 from windows and I need to install Nodejs to my target, but in target system there is no Internet connection. How can I install Nodejs with all dependencies in offline mode? Thanks in advance for your answers.

you can download node.js binary from its website and you can copy that file using ssh to your target machine.
extract it and add its path to your environment variables.
for more details you can visit here
here is my procedure
To install NodeJS we need an online server to download requirements.
You can download it from Node’s official website. Make sure you download Linux binary version of it.
Or you can use this link:
https://nodejs.org/dist/v16.14.0/node-v16.14.0-linux-x64.tar.xz
After downloading Linux Binary, copy it to your offline machine.
Then go to the directory you copied and unzip your downloaded file by using tar command.
Next step we are going to define the unzipped directory to our environment variables.to do this first go to /etc/profile.d and create a file. its name should be nodejs.sh
Copy commands below to nodejs.sh file and save it.
#!/bin/sh
EXPORT PATH=/home/node-v16.14.0-linux-x64/bin:$PATH
Note : /home/node-v16.14.0-linux-x64/bin (file address) may differ from yours
Restart your session and then enjoy NodeJS on your offline Linux machine.

Related

How do you install an extension into the VS Code Server that's the remote end of Remote-SSH when there is no Internet connection?

I'm working in a network that has no direct internet connection.
I have VS Code on my desktop PC and I use the "Remote - SSH" extension (version 0.55) to do development on a Linux VM. It works very well.
From time to time I have need to install other Extensions into both the desktop VS Code (which is an easily accomplished using code --install-extension <path-to-vsix>) and also the Linux end of the "Remote - SSH" server.
My question is "under these circumstances, how do I correctly install Extensions into the Linux server?"
I will describe what I do, which partially works sometimes, but I have used this process to upgrade extensions and lost features (like coloring of output) so there must be something missing. I would like to know the missing step.
Download the extension from an internet-connected computer. There is a "Download Extension" link on the Extension's page at marketplace.visualstudio.com/vscode. Copy it (however you can) onto your Linux development host.
Copy the VSIX file to ~/.vscode-server/data/CachedExtensionVSIXs/ and rename the file by getting rid of the ".vsix" extension.
Sometimes the extension becomes installable at this stage. I'm not sure what the differences are between cases when this has worked and when it sometimes doesn't work. At least it's worth trying --- go to VS Code, connect to your remote host, look in the Extensions panel and if you can install it from there, good for you. If it didn't work, close the connection to the Remote Host.
Assuming that the previous step failed, you will need to unzip the VSIX and copy it into place. The following code uses the cmake-tools extension as an example.
cd /tmp
mkdir cmaketools && cd cmaketools
7z x -tzip ~/.vscode-server/data/CachedExtensionVSIXs/ms-vscode.cmake-tools-1.4.2
cd ~/.vscode-server/extensions/
mv /tmp/cmaketools/extension ms-vscode.cmake-tools-1.4.2
cd ms-vscode.cmake-tools-1.4.2/
cp /tmp/cmaketools/extension.vsixmanifest .vsixmanifest
You can download the extension from the Marketplace and upload the extensionvsix file to the remote.
In the remote VSC use the Install from VSIX... command on the Extension bar top menu.

How to run Node.js after downloading binary version for Windows

If I downloaded Windows Binary version (.zip, node-v8.11.4-win-x64) from nodejs.org and unpack the ZIP, what the next should I do? I'm newbie in NodeJS and can't find the answer in the docs
I see the file node.exe inside of unpacked folder and as I know it's so-called "repl".
Where should I create the working folder for the projects and the file hello-world.js?
And in which Windows' terminal can I run the commands?
Windows 7 Home Premium 64-bit
You should put node.exe on your system PATH, that way you can use it from any directory. Here's a guide to edit path on Windows 7:
http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
You can then start it in any CMD shell or in PowerShell.
To test, start a new CMD window, and type
node -v
This should give you the node version.
I'd suggest you create something like a Projects directory for your code in your \user dir, with a subdirectory per project.
Once you've all this in place, just navigate to your project dir in your chosen shell and :
node hello-world.js

Compare time-stamp of a remote file with a local file using Ant

I have an installer file on my remote machine with Installer-000.zip name and i want to copy that file into my local machine(linux-CentOS) under /media/Data/Installer/ directory using ant ftp task.
I am able to copy the installer from remote server to my machine if the installer is not already present in my machine but when i again run the build.xml it downloads the heavy installer file again on my local machine which makes the whole building time much longer.
so esentially i want to comapre the time-stamp of my installer(remote) with one on my local machine and copy from remote to local if the installer file present on remote machine has a newer time-stamp.
(Obviously I want an ant task to do this. I am using ant-version 1.9.6 )
any suggestion or comments would be appreciated !
Thanks in advance !
I don't think there is an ANT task that will calculate the checksum of a remote file. I suggest a different approach of using rsync over ssh.
Ant, download fileset from remote machine

Is there a security risk to having node.js installed on a shared server?

I have installed "node.js" on a shared server. I have rename the directory so that it can not be found easily. Also I have my node directory in a location above /public_html.
I have also installed node on my PC for programming and testing easy on my local system vrs my web server.
What I would like to know is does this create a security risk where someone could hack my sites if they knew where my node installation files exist?
I have not added the path to my bash, so the commands have to be executed manually by using the ~ representing home, and the path. Such as:
~/pathtodir/bin/npm -v

Make a cd run a php website NOT on windows

I Have the needs to run a php+sqlite (or mysql...) website from a cd.
For windows I found a nice solution (xampp) but I need to make the cd compatible with osx and linux too!
So I basically want to start a webserver (without having to install it) and then automagically open a browser pointing to the local copy of the website.
Thank you in advance
there is xampp for linux but the best way to run in it from cd is to create a executable shell script to deploy and set/unset parameters, launch software and deal with configuration
although you could use html5 alternatives javascript+sqlite.

Resources