Skip to content

Commit b1bf32e

Browse files
sam-githubrvagg
authored andcommitted
doc: clarify Python configuration, etc
Clarify that: - node-gyp is not used to build Node.js - PYTHON can be used to add a Python search path - NODE_GYP_FORCE_PYTHON can be used to override all Python search paths - That a compatible Python is searched for PR-URL: #1908 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent dd0e97e commit b1bf32e

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# `node-gyp` - Node.js native addon build tool
22

3-
`node-gyp` is a cross-platform command-line tool written in Node.js for compiling
4-
native addon modules for Node.js. It bundles the [gyp](https://gyp.gsrc.io)
5-
project used by the Chromium team and takes away the pain of dealing with the
6-
various differences in build platforms.
3+
`node-gyp` is a cross-platform command-line tool written in Node.js for
4+
compiling native addon modules for Node.js. It contains a fork of the
5+
[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.
8+
9+
Note that `node-gyp` is _not_ used to build Node.js itself.
710

811
Multiple target versions of Node.js are supported (i.e. `0.8`, ..., `4`, `5`, `6`,
912
etc.), regardless of what version of Node.js is actually installed on your system
@@ -25,7 +28,9 @@ $ npm install -g node-gyp
2528

2629
You will also need to install:
2730

28-
NOTE: node-gyp is compatible with Python v2.7, v3.5, v3.6, or v3.7 but node itself is not yet compatible with Python 3.
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.
2934

3035
### On Unix
3136

@@ -76,6 +81,14 @@ value:
7681
$ npm config set python /path/to/executable/python
7782
```
7883

84+
If the `PYTHON` environment variable is set to the path of a Python executable,
85+
it will be used if it is a compatible Python.
86+
87+
If the `NODE_GYP_FORCE_PYTHON` environment variable is set to the path of a
88+
Python executable, it will be used instead of any of the other configured or
89+
builtin Python search paths. If its not a compatible Python, no further
90+
searching will be done.
91+
7992
## How to Use
8093

8194
To compile your native addon, first go to its root directory:

0 commit comments

Comments
 (0)