Skip to content

Commit

Permalink
docs: Set npm_config_runtime when using npm
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Sep 24, 2015
1 parent 6260470 commit 39695cd
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions docs/tutorial/using-native-node-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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
```

0 comments on commit 39695cd

Please sign in to comment.