Skip to content

Commit adbbbda

Browse files
cotejprogerwang
authored andcommitted
Added details regarding compilation on Windows
1 parent d74658e commit adbbbda

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/For Users/Advanced/Use Native Node Modules.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,19 @@ npm install
4040
```
4141

4242
!!! warning "Note for Windows"
43-
On Windows, `npm_config_node_gyp` have to be set to `path\to\global\node_modules\nw-gyp\bin\nw-gyp.js` instead of its batch script `nw-gyp.cmd`. This should be a [bug of npm](https://github.com/npm/npm/issues/14543).
43+
You will need to have a compiler installed. You can get one by installing the [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools). You will also need Python 2.7 (version 3.x is not supported).
44+
The `npm_config_node_gyp` environment variable has to be set to `path\to\global\node_modules\nw-gyp\bin\nw-gyp.js` instead of the `nw-gyp.cmd` batch script. This is a [bug of npm](https://github.com/npm/npm/issues/14543).
45+
  You must use `set` instead of `export` to set environment variables in Windows. Here is a full example (Windows 10, Visual C++ Build Tool v2015):
46+
47+
```Batchfile
48+
set PYTHON=C:\Python27\python.exe
49+
set npm_config_target=0.21.6
50+
set npm_config_arch=x64
51+
set npm_config_runtime=node-webkit
52+
set npm_config_build_from_source=true
53+
set npm_config_node_gyp=C:\Users\xxxxxxxxx\AppData\Roaming\npm\node_modules\nw-gyp\bin\nw-gyp.js
54+
npm install --msvs_version=2015
55+
```
4456

4557
## Manually Rebuild
4658

0 commit comments

Comments
 (0)