Skip Build Unless Installing on IBM i

Issue #53 resolved
David Russo created an issue

I work on a package that installs on multiple platforms, including IBM i. I've put idb-connector under optionalDependencies in my package.json -- this allows NPM to proceed with installing my package on non-IBM i platforms, where idb-connector obviously does not work. Programming logic in my package then selects the appropriate database connector for the appropriate platform.

This allows me to install on any platform, but I get a lot of unnecessary output and error messages when installing on non-IBM i platforms because NPM goes through the motions of trying to build idb-connector. To see what I mean, try 'npm install profoundjs' on a Windows PC.

I'm wondering if it's possible to set up so that NPM does not try to build/install idb-connector unless installing on IBM i.

Maybe it's just a matter of setting the 'os' key in idb-connector's package.json?

https://docs.npmjs.com/files/package.json#os

Comments (6)

  1. mengxumx Account Deactivated

    The host operating system is determined by process.platform which currently return aix on IBM i. So the AIX system will still install it ( while many other os not). We may let it return the true os name in future Node.js releases. But for now, seems we can only use aix to distinguish.

  2. Log in to comment