33` node-gyp ` is a cross-platform command-line tool written in Node.js for
44compiling native addon modules for Node.js. It contains a fork of the
55[ gyp] ( https://gyp.gsrc.io ) project that was previously used by the Chromium
6- team and takes away the pain of dealing with the various differences in build
7- platforms.
6+ team, extended to support the development of Node.js native addons.
87
98Note that ` node-gyp ` is _ not_ used to build Node.js itself.
109
@@ -14,23 +13,18 @@ etc.), regardless of what version of Node.js is actually installed on your syste
1413
1514## Features
1615
17- * Easy to use, consistent interface
18- * Same commands to build your module on every platform
19- * Supports multiple target versions of Node.js
16+ * The same build commands work on any of the supported platforms
17+ * Supports the targetting of different versions of Node.js
2018
2119## Installation
2220
23- You can install with ` npm ` :
21+ You can install ` node-gyp ` using ` npm ` :
2422
2523``` bash
2624$ npm install -g node-gyp
2725```
2826
29- You will also need to install:
30-
31- NOTE: node-gyp is compatible with Python v2.7, v3.5, v3.6, or v3.7. If the
32- Python to use is not explicitly configured (see "Configuring Python Dependency"
33- below) it will attempt to find a compatible Python executable.
27+ Depending on your operating system, you will need to install:
3428
3529### On Unix
3630
@@ -67,27 +61,30 @@ Install tools and configuration manually:
6761
6862### Configuring Python Dependency
6963
70- If you have multiple Python versions installed, you can identify which Python
71- version ` node-gyp ` uses by setting the ` --python ` variable:
64+ ` node-gyp ` requires that you have installed a compatible version of Python, one of: v2.7, v3.5, v3.6,
65+ or v3.7. If you have multiple Python versions installed, you can identify which Python
66+ version ` node-gyp ` should use in one of the following ways:
67+
68+ 1 . by setting the ` --python ` command-line option, e.g.:
7269
7370``` bash
7471$ node-gyp < command> --python /path/to/executable/python
7572```
7673
77- If ` node-gyp ` is called by way of ` npm ` , * and* you have multiple versions of
74+ 2 . If ` node-gyp ` is called by way of ` npm ` , * and* you have multiple versions of
7875Python installed, then you can set ` npm ` 's 'python' config key to the appropriate
7976value:
8077
8178``` bash
8279$ npm config set python /path/to/executable/python
8380```
8481
85- If the ` PYTHON ` environment variable is set to the path of a Python executable,
86- it will be used if it is a compatible Python .
82+ 3 . If the ` PYTHON ` environment variable is set to the path of a Python executable,
83+ then that version will be used, if it is a compatible version .
8784
88- If the ` NODE_GYP_FORCE_PYTHON ` environment variable is set to the path of a
85+ 4 . If the ` NODE_GYP_FORCE_PYTHON ` environment variable is set to the path of a
8986Python executable, it will be used instead of any of the other configured or
90- builtin Python search paths. If its not a compatible Python , no further
87+ builtin Python search paths. If it's not a compatible version , no further
9188searching will be done.
9289
9390## How to Use
@@ -147,15 +144,16 @@ A barebones `gyp` file appropriate for building a Node.js addon could look like:
147144}
148145```
149146
150- Some additional resources for addons and writing ` gyp ` files:
147+ ## Further reading
148+
149+ Some additional resources for Node.js native addons and writing ` gyp ` configuration files:
151150
152151 * [ "Going Native" a nodeschool.io tutorial] ( http://nodeschool.io/#goingnative )
153152 * [ "Hello World" node addon example] ( https://github.com/nodejs/node/tree/master/test/addons/hello-world )
154153 * [ gyp user documentation] ( https://gyp.gsrc.io/docs/UserDocumentation.md )
155154 * [ gyp input format reference] ( https://gyp.gsrc.io/docs/InputFormatReference.md )
156155 * [ * "binding.gyp" files out in the wild* wiki page] ( https://github.com/nodejs/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild )
157156
158-
159157## Commands
160158
161159` node-gyp ` responds to the following commands:
0 commit comments