A command line tool to easily install prebuilt binaries for multiple version of node/iojs on a specific platform
Last updated 2 years ago by shiftkey .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @shiftkey/prebuild-install 
SYNC missed versions from official npm registry.


A command line tool to easily install prebuilt binaries for multiple version of node/iojs on a specific platform.

npm Node version Build Status Build status david js-standard-style

prebuild-install supports installing prebuilt binaries from GitHub by default.


Change your package.json install script to:

  "scripts": {
    "install": "prebuild-install || node-gyp rebuild"


You need to provide prebuilds made by prebuild.


prebuild-install [options]

  --download    -d  [url]       (download prebuilds, no url means github)
  --target      -t  version     (version to install for)
  --runtime     -r  runtime     (Node runtime [node, napi or electron] to build or install for, default is node)
  --path        -p  path        (make a prebuild-install here)
  --token       -T  gh-token    (github token for private repos)
  --tag-prefix <prefix>         (github tag prefix, default is "v")
  --build-from-source           (skip prebuild download)
  --verbose                     (log verbosely)
  --libc                        (use provided libc rather than system default)
  --debug                       (set Debug or Release configuration)
  --version                     (print prebuild-install version and exit)

When prebuild-install is run via an npm script, options --build-from-source, --debug and --download, may be passed through via arguments given to the npm command.

Private Repositories

prebuild-install supports downloading prebuilds from private GitHub repositories using the -T <github-token>:

$ prebuild-install -T <github-token>

If you don't want to use the token on cli you can put it in ~/.prebuild-installrc:


Alternatively you can specify it in the prebuild-install_token environment variable.

Note that using a GitHub token uses the API to resolve the correct release meaning that you are subject to the (GitHub Rate Limit).

Create GitHub Token

To create a token:

  • Go to this page
  • Click the Generate new token button
  • Give the token a name and click the Generate token button, see below


The default scopes should be fine.

Custom binaries

The end user can override binary download location through environment variables in their .npmrc file. The variable needs to meet the mask % your package name %_binary_host or % your package name %_binary_host_mirror. For example:


Note that the package version subpath and file name will still be appended. So if you are installing leveldown@1.2.3 the resulting url will be:



All prebuilt binaries are cached to minimize traffic. So first prebuild-install picks binaries from the cache and if no binary could be found, it will be downloaded. Depending on the environment, the cache folder is determined in the following order:

  • ${npm_config_cache}/_prebuilds
  • ${APP_DATA}/npm-cache/_prebuilds
  • ${HOME}/.npm/_prebuilds



Current Tags

  • 5.2.4                                ...           latest (2 years ago)

2 Versions

  • 5.2.4                                ...           2 years ago
  • 5.2.2                                ...           2 years ago
Maintainers (1)
Today 0
This Week 0
This Month 12
Last Day 0
Last Week 12
Last Month 36
Dependencies (16)
Dev Dependencies (6)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |