Seeding Node.JS With Bundled Installs

Max Lynch
2 min readJan 2, 2017

--

One of the big challenges we face at Ionic is distributing our CLI and SDK tools. Like many (most?) JavaScript based projects, we distribute our tools on NPM, including a global command line tool and non-global libraries for our framework and services.

While we love NPM, we find our community struggles installing our Node.js project and dependencies. Part of the challenge is the diversity of errors users encounter, which often come from insufficient permissions, lingering “uninstalled files” causing issues, and version compatibility.

There are a few ways we could work around this. The first would be a “doctor” task we have the user install separately that inspects their local environment to see if everything is A-OK before doing the full install.

A second one is more interesting: bundling Ionic with Node.js/NPM all at once. Imagine instead of having the user install Node separately and run npm install -g ionic, they download IonicWithNode.dmg/exe and an installer bundled in that checks/installs Node (and runs other scripts we might provide), and then installs Ionic and any other packages at once.

This could be a generic tool (perhaps available on NPM 🙂) called npm-packager that takes a package.json with some scripts like packager:before_build, packager:after_build, uses the metadata (license/author/etc.) and dependencies listed (perhaps with a special “global” section) and generates a packager/installer for various platforms and without bundling any of the actual dependency code (just metadata).

Does this exist, or should it? Seems like something Electron does/could do, and I’ve seen domain specific examples like the Visual Studio Tools for Apache Cordova installer but that’s not generic.

Sounds like something that could clash with the node license in terms of distribution https://github.com/nodejs/node/blob/master/LICENSE

--

--

Max Lynch

Co-founder @ionicframework. I build stuff for computers, humans, and robots.