Node.js: Packaging modules for offline deployment using npm-bundle

nodejs-logoIn a production environment, it is common to have restricted internet access on the production deployment hosts.  This means that using the standard ‘npm install’ and pulling modules from the repository is not an option.

Given the breadth of the dependency graph required for most modules, this packaging is something you want automated without needing to modify the package.json file by hand.

After various failed attempts at: using npmbox, scripts wrapping up ‘npm pack’, and archiving the entire node_modules directory – the npm-bundle module finally provided a proper solution.

Continue reading “Node.js: Packaging modules for offline deployment using npm-bundle”