You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: node-gyp is compatible with both Python 2.7 and 3.7 but Node.js itself is not yet compatible with Python 3.
Careful review please because I am not a Windows user.
* You also need to install the `Command Line Tools` via Xcode. You can find this under the menu `Xcode -> Preferences -> Locations` (or by running `xcode-select --install` in your Terminal)
39
41
* This step will install `gcc` and the related toolchain containing `make`
40
42
41
43
### On Windows
42
44
45
+
Install the current version of Python from the [Microsoft Store package](https://docs.python.org/3.7/using/windows.html#the-microsoft-store-package).
46
+
43
47
#### Option 1
44
48
45
49
Install all the required tools and configurations using Microsoft's [windows-build-tools](https://github.com/felixrieseberg/windows-build-tools) using `npm install --global --production windows-build-tools` from an elevated PowerShell or CMD.exe (run as Administrator).
@@ -50,7 +54,6 @@ Install tools and configuration manually:
50
54
* Install Visual C++ Build Environment: [Visual Studio Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools)
51
55
(using "Visual C++ build tools" workload) or [Visual Studio 2017 Community](https://visualstudio.microsoft.com/pl/thank-you-downloading-visual-studio/?sku=Community)
52
56
(using the "Desktop development with C++" workload)
53
-
* Install [Python 2.7](https://www.python.org/downloads/) (`v3.x.x` is not supported), and run `npm config set python python2.7` (or see below for further instructions on specifying the proper Python version and path.)
54
57
* Launch cmd, `npm config set msvs_version 2017`
55
58
56
59
If the above steps didn't work for you, please visit [Microsoft's Node.js Guidelines for Windows](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules) for additional tips.
@@ -63,15 +66,15 @@ If you have multiple Python versions installed, you can identify which Python
63
66
version `node-gyp` uses by setting the `--python` variable:
64
67
65
68
```bash
66
-
$ node-gyp --python /path/to/python2.7
69
+
$ node-gyp --python /path/to/executable/python
67
70
```
68
71
69
72
If `node-gyp` is called by way of `npm`, *and* you have multiple versions of
70
73
Python installed, then you can set `npm`'s 'python' config key to the appropriate
71
74
value:
72
75
73
76
```bash
74
-
$ npm config set python /path/to/executable/python2.7
77
+
$ npm config set python /path/to/executable/python
75
78
```
76
79
77
80
## How to Use
@@ -120,7 +123,7 @@ JSON-like format. This file gets placed in the root of your package, alongside
120
123
121
124
A barebones `gyp` file appropriate for building a Node.js addon could look like:
122
125
123
-
```python
126
+
```python
124
127
{
125
128
"targets": [
126
129
{
@@ -180,7 +183,7 @@ Some additional resources for addons and writing `gyp` files:
180
183
| `--proxy=$url` | Set HTTP proxy for downloading header tarball
181
184
| `--cafile=$cafile` | Override default CA chain (to download tarball)
182
185
| `--nodedir=$path` | Set the path to the node source code
183
-
| `--python=$path` | Set path to the Python 2 binary
186
+
| `--python=$path` | Set path to the Python binary
184
187
| `--msvs_version=$version` | Set Visual Studio version (Windows only)
185
188
| `--solution=$solution` | Set Visual Studio Solution version (Windows only)
0 commit comments