If you ever need to install a Node-RED package on an system that’s on an isolated network without internet access, you can use npm to install it from an archive file through the command line.
You will need shell access to do the installation, and access to a system that does have an internet connection to download the package files before moving them over to the isolated system.
- Start by installing the package on the system with internet access to get the required package files.
sudo npm install <package>
- Create the package tarball archive with the name
<package-version>.tgz. You will need to get a copy of that file off the device.
sudo npm pack <package>
- To install the package just put the tarball on the target system, in the unsecured file area on an EPIC, for example, then navigate to that folder using SSH and install the package directly from the tarball.
sudo npm install <package-version>.tgz
Wait. It may take a lot longer than you expect but should complete eventually.
After you have the package installed, restart the Node-RED runtime either by disabling then re-enabling it, or by rebooting your system.
Once you confirm the package is installed you can delete the tarball and you’re good to go.