I am currently developing an open source project that needs to be published on NPM. It's a C++ Node addon, and it is only available for Linux and Mac.
I would like to know if it's possible to add a flag in binding.gyp returning an error if OS is Windows.
Thanks in advance
You can do this in package.json easily:
"os": ["!win32"]
https://docs.npmjs.com/files/package.json#os
I'm not sure if there's a nice way to do this in binding.gyp. You might be able to run something inside "conditions": [['OS=="win"', ... that will fail, but it would be a hack.