https://www.npmjs.com/package/node-gyp
node-gyp
Node.js native addon build tool
Node.js native addon build tool
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo,
Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >node-gypde> is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js. It bundles the gyp project
used by the Chromium team and takes away the pain of dealing with the various differences in build platforms. It is the replacement to the de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit;
font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >node-wafde> program which
is removed for node de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation
Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >v0.8de>. If you have a native addon for node that still has a de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style:
inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);"
>wscriptde> file, then you should definitely add a de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height:
inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >binding.gypde> file to support the latest versions of node.
Multiple target versions of node are supported (i.e. de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit;
font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >0.8de>, ..., de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit;
font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >4de>, de
style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco,
Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >5de>, de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch:
inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >6de>, etc.), regardless of what version of node is actually
installed on your system (de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas,
'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >node-gypde> downloads the necessary development files or headers for the target version).
Features:
- Easy to use, consistent interface
- Same commands to build your module on every platform
- Supports multiple target versions of Node
Installation
You can install with de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation
Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >npmde>:
$ npm install -g node-gyp
You will also need to install:
On Unix:
- de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo,
Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >pythonde> (de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch:
inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >v2.7de> recommended, de style="box-sizing: border-box;
margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align:
baseline; background-color: rgb(245, 245, 245);" >v3.x.xde> is not supported) - de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo,
Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >makede> - A proper C/C++ compiler toolchain, like GCC
- de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo,
On Mac OS X:
- de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo,
Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >pythonde> (de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch:
inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >v2.7de> recommended, de style="box-sizing: border-box;
margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align:
baseline; background-color: rgb(245, 245, 245);" >v3.x.xde> is not supported) (already installed on Mac OS X) - Xcode
- You also need to install the de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas,
'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >Command Line Toolsde> via Xcode. You can find this under the menu de style="box-sizing: border-box; margin: 0px; padding: 0px;
border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color:
rgb(245, 245, 245);" >Xcode -> Preferences -> Downloadsde> - This step will install de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation
Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >gccde> and the related toolchain containing de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit;
font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >makede>
- You also need to install the de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas,
- de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo,
On Windows:
- Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using de style="box-sizing: border-box; margin:
0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align:
baseline; background-color: rgb(245, 245, 245);" >npm install --global --production windows-build-toolsde> from an elevated PowerShell or CMD.exe (run as Administrator). - Option 2: Install tools and configuration manually:
Visual C++ Build Environment:
Option 1: Install Visual C++ Build Tools using the Default Install option.
Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during
setup. This also works with the free Community and Express for Desktop editions.
Install Python 2.7 (de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch:
inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >v3.x.xde> is not supported), and run de style="box-sizing:
border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace;
vertical-align: baseline; background-color: rgb(245, 245, 245);" >npm config set python python2.7de> (or see below for further instructions on specifying the proper Python version and path.)Launch cmd, de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation
Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >npm config set msvs_version 2015de>
If the above steps didn't work for you, please visit Microsoft's Node.js Guidelines for Windows for
additional tips.- Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using de style="box-sizing: border-box; margin:
If you have multiple Python versions installed, you can identify which Python version de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size:
inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >node-gypde> uses by setting the '--python' variable:
$ node-gyp --python /path/to/python2.7
If de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo,
Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >node-gypde> is called by way of de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight:
inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >npmde> and you
have multiple versions of Python installed, then you can set de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height:
inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >npmde>'s 'python' config key to the appropriate value:
$ npm config set python /path/to/executable/python2.7
Note that OS X is just a flavour of Unix and so needs de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit;
font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >pythonde>, de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit;
font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >makede>,
and C/C++. An easy way to obtain these is to install XCode from Apple, and then use it to install the command line tools (under Preferences -> Downloads).
How to Use
To compile your native addon, first go to its root directory:
$ cd my_node_addon
The next step is to generate the appropriate project build files for the current platform. Use de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit;
font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >configurede> for that:
$ node-gyp configure
Note: The de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas,
'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >configurede> step looks for the de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit;
font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >binding.gypde> file
in the current directory to process. See below for instructions on creating the de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size:
inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >binding.gypde> file.
Now you will have either a de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas,
'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >Makefilede> (on Unix platforms) or a de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit;
font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >vcxprojde> file
(on Windows) in the de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation
Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >build/de> directory. Next invoke the de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant:
inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >buildde> command:
$ node-gyp build
Now you have your compiled de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas,
'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >.nodede> bindings file! The compiled bindings end up in de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;
font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245,
245, 245);" >build/Debug/de> orde style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family:
Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >build/Release/de>, depending on the build mode. At this point you can require the de style="box-sizing: border-box;
margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align:
baseline; background-color: rgb(245, 245, 245);" >.nodede> file with Node and run your tests!
Note: To create a Debug build of the bindings file, pass the de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch:
inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >--debugde> (or de style="box-sizing: border-box; margin:
0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align:
baseline; background-color: rgb(245, 245, 245);" >-dde>) switch when running either thede style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit;
font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >configurede>, de style="box-sizing: border-box; margin: 0px;
padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;
background-color: rgb(245, 245, 245);" >buildde> or de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height:
inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >rebuildde> command.
The "binding.gyp" file
Previously when node had de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas,
'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >node-wafde> you had to write a de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit;
font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >wscriptde> file.
The replacement for that is the de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas,
'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >binding.gypde>file, which describes the configuration to build your module in a JSON-like format. This file gets placed in the root
of your package, alongside the de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas,
'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >package.jsonde> file.
A barebones de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation
Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >gypde> file appropriate for building a node addon looks like:
{"targets": [{"target_name": "binding","sources": [ "src/binding.cc" ]}]}
Some additional resources for addons and writing de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit;
font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >gypde> files:
- "Going Native" a nodeschool.io tutorial
- "Hello World" node addon example
- gyp user documentation
- gyp input format reference
- "binding.gyp" files out in the wild wiki page
Commands
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo,
Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >node-gypde> responds to the following commands:
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >helpde> | Shows the help dialog |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >buildde> | Invokes de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >makede>/de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >msbuild.exede> and builds the native addon |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >cleande> | Removes the de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >buildde> directory if it exists |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >configurede> | Generates project build files for the current platform |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >rebuildde> | Runs de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >cleande>, de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >configurede> and de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >buildde> all in a row |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >installde> | Installs node header files for the given version |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >listde> | Lists the currently installed node header versions |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >removede> | Removes the node header files for the given version |
Command Options
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo,
Monaco, Courier, monospace; vertical-align: baseline; background-color: rgb(245, 245, 245);" >node-gypde> accepts the following command options:
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >-j nde>, de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--jobs nde> | Run make in parallel |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--target=v6.2.1de> | Node version to build for (default=process.version) |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--sillyde>, de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--loglevel=sillyde> | Log all progress to console |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--verbosede>, de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--loglevel=verbosede> | Log most progress to console |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--silentde>, de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--loglevel=silentde> | Don't log anything to console |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >debugde>, de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--debugde> | Make Debug build (default=Release) |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--releasede>, de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--no-debugde> | Make Release build |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >-C $dirde>, de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--directory=$dirde> | Run command in different directory |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--make=$makede> | Override make command (e.g. gmake) |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--thin=yesde> | Enable thin static libraries |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--arch=$archde> | Set target architecture (e.g. ia32) |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--tarball=$pathde> | Get headers from a local tarball |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--devdir=$pathde> | SDK download directory (default=~/.node-gyp) |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--ensurede> | Don't reinstall headers if already present |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--dist-url=$urlde> | Download header tarball from custom URL |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--proxy=$urlde> | Set HTTP proxy for downloading header tarball |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--cafile=$cafilede> | Override default CA chain (to download tarball) |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--nodedir=$pathde> | Set the path to the node binary |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--python=$pathde> | Set path to the python (2) binary |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--msvs_version=$versionde> | Set Visual Studio version (win) |
de style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: Consolas, 'Liberation Mono', Menlo, Monaco, Courier, monospace; vertical-align: baseline;" >--solution=$solutionde> | Set Visual Studio Solution version (win) |
License
(The MIT License)
Copyright (c) 2012 Nathan Rajlich <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.