Skip to content

Commit

Permalink
doc: clarify Python configuration, etc
Browse files Browse the repository at this point in the history
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 <cclauss@me.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
sam-github authored and rvagg committed Oct 4, 2019
1 parent 01c46ee commit 04ce59f
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# `node-gyp` - Node.js native addon build tool

`node-gyp` is a cross-platform command-line tool written in Node.js for compiling
native addon modules for Node.js. It bundles the [gyp](https://gyp.gsrc.io)
project used by the Chromium team and takes away the pain of dealing with the
various differences in build platforms.
`node-gyp` is a cross-platform command-line tool written in Node.js for
compiling native addon modules for Node.js. It contains a fork of the
[gyp](https://gyp.gsrc.io) project that was previously used by the Chromium
team and takes away the pain of dealing with the various differences in build
platforms.

Note that `node-gyp` is _not_ used to build Node.js itself.

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

You will also need to install:

NOTE: node-gyp is compatible with Python v2.7, v3.5, v3.6, or v3.7. If the
Python to use is not explicitly configured (see "Configuring Python Dependency"
below) it will attempt to find a compatible Python executable.

### On Unix

* `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported)
Expand Down Expand Up @@ -73,6 +80,14 @@ value:
$ npm config set python /path/to/executable/python2.7
```

If the `PYTHON` environment variable is set to the path of a Python executable,
it will be used if it is a compatible Python.

If the `NODE_GYP_FORCE_PYTHON` environment variable is set to the path of a
Python executable, it will be used instead of any of the other configured or
builtin Python search paths. If its not a compatible Python, no further
searching will be done.

## How to Use

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

0 comments on commit 04ce59f

Please sign in to comment.