Skip to content

Commit 5cd0294

Browse files
saboyareconbot
authored andcommitted
Bumping prebuild version and updating docs with info about building against NW.js headers. (#1461)
1 parent 17e891e commit 5cd0294

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

packages/serialport-util/packages/node-serialport/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,24 @@ To recompile `serialport` (or any native Node.js module) for Electron, you can u
148148

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

151+
#### NW.js
152+
153+
[NW.js](https://nwjs.io/) is an app runtime based on Chromium and node.js.
154+
155+
Like Electron, NW.js also requires compilation against its own specific headers.
156+
157+
To instruct `prebuild` to build against the correct headers, place a file named `.prebuildrc` on your package root with the following content:
158+
159+
```
160+
build_from_source=true
161+
runtime=node-webkit
162+
target=<target_version>
163+
```
164+
165+
Where `<target_version>` is the NW.js version you are building against (for example, `0.26.6`).
166+
167+
OBS: NW.js support requires `prebuild >= 7.3.0`.
168+
151169
#### Illegal Instruction
152170

153171
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.

packages/serialport-util/packages/node-serialport/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"istanbul": "^0.4.4",
8080
"jsdoc": "^3.5.5",
8181
"mocha": "^4.0.0",
82-
"prebuild": "^7.0.0",
82+
"prebuild": "^7.4.0",
8383
"proxyquire": "^1.7.10",
8484
"sinon": "^4.1.5"
8585
},

0 commit comments

Comments
 (0)