Skip to content
springmeyer edited this page Oct 17, 2014 · 6 revisions

Frequently Ask Questions about node-pre-gyp

Is my node-pre-gyp packaged binary going to work on other platforms?

Yes, with a few important gochas:

  • On Windows you'll need to make sure your users have the right C++ runtime installed.
  • On OS X you'll need to make sure you compile your module with the desired value passed to the -mmacosx-version-min flag.
  • On Linux you'll need to make sure to create your binaries on the oldest system you want to support. This means practically that if you create your binaries on Ubuntu Precise they will work on Ubuntu Precise and any other linux distro more recent (like Debian Sid or Ubuntu Trusty).

See the External-libraries for all the details.

Does a binary exist for a given platform and how can I manually download it?

If you'd like to know if a binary exists and download it outside of an npm install scenario you can use node-pre-gyp on the command line like:

$ git clone [email protected]:nodegit/nodegit.git
$ cd nodegit
$ npm install node-pre-gyp
# reveal the url to the hosted binary for your system arch (for me OS X):
$ ./node_modules/.bin/node-pre-gyp reveal hosted_tarball --silent
 https://s3.amazonaws.com/nodegit/nodegit/nodegit-v0.1.4-node-v11-darwin-x64.tar.gz 
# reveal the url to the windows version:
$ ./node_modules/.bin/node-pre-gyp reveal hosted_tarball --silent --target_platform=win32
https://s3.amazonaws.com/nodegit/nodegit/nodegit-v0.1.4-node-v11-win32-x64.tar.gz
# confirm it exists
$ curl -s -I $(./node_modules/.bin/node-pre-gyp reveal hosted_tarball --silent --target_platform=win32) | grep '200 OK'
HTTP/1.1 200 OK # yep!
Clone this wiki locally