Skip to content

Commit

Permalink
Bumping prebuild version and updating docs with info about building a…
Browse files Browse the repository at this point in the history
…gainst NW.js headers. (serialport#1461)
  • Loading branch information
saboya authored and IvanSanchez committed Feb 27, 2018
1 parent dcb9a06 commit a7204d5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,24 @@ To recompile `serialport` (or any native Node.js module) for Electron, you can u

For an example project, check out [`electron-serialport`](https://github.com/johnny-five-io/electron-serialport).

#### NW.js

[NW.js](https://nwjs.io/) is an app runtime based on Chromium and node.js.

Like Electron, NW.js also requires compilation against its own specific headers.

To instruct `prebuild` to build against the correct headers, place a file named `.prebuildrc` on your package root with the following content:

```
build_from_source=true
runtime=node-webkit
target=<target_version>
```

Where `<target_version>` is the NW.js version you are building against (for example, `0.26.6`).

OBS: NW.js support requires `prebuild >= 7.3.0`.

#### Illegal Instruction

The pre-compiled binaries assume a fully capable chip. Intel's [Galileo 2](https://software.intel.com/en-us/iot/hardware/galileo), for example, lacks a few instruction sets from the `ia32` architecture. A few other platforms have similar issues. If you get `Illegal Instruction` when trying to run Node-Serialport, you'll need to ask npm to rebuild the Serialport binary.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"istanbul": "^0.4.4",
"jsdoc": "^3.5.5",
"mocha": "^4.0.0",
"prebuild": "^7.0.0",
"prebuild": "^7.4.0",
"proxyquire": "^1.7.10",
"sinon": "^4.1.5"
},
Expand Down

0 comments on commit a7204d5

Please sign in to comment.