From ff29e7bef91d17834818d7b3ffa54cba0913e613 Mon Sep 17 00:00:00 2001 From: Francis Gulotta Date: Thu, 5 May 2016 15:04:23 -0400 Subject: [PATCH] =?UTF-8?q?Add=20instructions=20for=20=E2=80=9CIllegal=20I?= =?UTF-8?q?nstruction=E2=80=9D=20errors=20(#786)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #747 closes #779 --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index a84fbf3..2f62fcc 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ For getting started with node-serialport, we recommend you begin with the follow * [Ubuntu Linux](#ubuntu-linux) * [Alpine Linux](#alpine-linux) * [Raspberry Pi Linux](#raspberry-pi-linux) + * [Illegal Instruction](#illegal-instruction) * [Usage](#usage) * [Opening a Port](#opening-a-port) * [Listing Ports](#listing-ports) @@ -137,6 +138,21 @@ npm install serialport --build-from-source=serialport Follow the instructions for [setting up a Raspberry pi for use with Johnny-Five and Raspi IO](https://github.com/nebrius/raspi-io/wiki/Getting-a-Raspberry-Pi-ready-for-NodeBots). These projects use Node Serialport under the hood. +#### Illegal Instruction + +The pre-compiled binaries assume a fully capable chip. The Galileo 2 for example lacks a few instruction sets from the `ia32` architecture. A few other platforms have similar issues. So if you get `Illegal Instruction` when trying to run serialport you'll need to rebuild the serialport binary by asking npm to rebuild it. + +```bash +# Will ask npm to build serialport during install time +npm install serialport --build-from-source + +# If you have a package that depends on serialport you can ask npm to rebuild it specifically. +npm rebuild serialport --build-from-source + +# Or leave out the package name to rebuild everything. +npm rebuild --build-from-source +``` + ## Usage Opening a serial port: