'How to install C++ npm module offline?

How can I install C++ npm module, such as kerberos on a machine that doesn't have internet access? I know I can probably just install the regular npm modules on a machine with internet connection and then just copy it to the machine without the internet, but what can I do with modules that need to be compiled? Thanks in advance for your help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source