Browse Source

docs: Set npm_config_runtime when using npm

Refs https://github.com/mapbox/node-pre-gyp/pull/175.
Cheng Zhao 9 years ago
parent
commit
39695cdb85
1 changed files with 13 additions and 12 deletions
  1. 13 12
      docs/tutorial/using-native-node-modules.md

+ 13 - 12
docs/tutorial/using-native-node-modules.md

@@ -34,6 +34,19 @@ npm install --save-dev electron-rebuild
 node ./node_modules/.bin/electron-rebuild
 ```
 
+### The npm Way
+
+You can also use `npm` to install modules. The steps are exactly the same with
+Node modules, except that you need to setup some environment variables:
+
+```bash
+export npm_config_disturl=https://atom.io/download/atom-shell
+export npm_config_target=0.33.1
+export npm_config_arch=x64
+export npm_config_runtime=electron
+HOME=~/.electron-gyp npm install module-name
+```
+
 ### The node-gyp Way
 
 To build Node modules with headers of Electron, you need to tell `node-gyp`
@@ -48,15 +61,3 @@ The `HOME=~/.electron-gyp` changes where to find development headers. The
 `--target=0.29.1` is version of Electron. The `--dist-url=...` specifies
 where to download the headers. The `--arch=x64` says the module is built for
 64bit system.
-
-### The npm Way
-
-You can also use `npm` to install modules. The steps are exactly the same with
-Node modules, except that you need to setup some environment variables:
-
-```bash
-export npm_config_disturl=https://atom.io/download/atom-shell
-export npm_config_target=0.29.1
-export npm_config_arch=x64
-HOME=~/.electron-gyp npm install module-name
-```