Giter VIP home page Giter VIP logo

pi-spi's Introduction

pi-spi

Simple asyncronous node.js SPI library for Raspberry Pi (and likely other embedded Linux platforms that provide /dev/spidevN.N).

Example

npm install pi-spi

var SPI = require('pi-spi');

var spi = SPI.initialize("/dev/spidev0.0"),
    test = Buffer.from("Hello, World!");

// reads and writes simultaneously
// e.g. jumper MOSI [BCM 10, physical pin 19] to MISO [BCM 9, physical pin 21]
spi.transfer(test, test.length, function (e,d) {
    if (e) console.error(e);
    else console.log("Got \""+d.toString()+"\" back.");
    
    if (test.toString() === d.toString()) {
        console.log(msg);
    } else {
        // NOTE: this will likely happen unless MISO is jumpered to MOSI
        console.warn(msg);
        process.exit(-2);
    }
});

Probably requires running node under sudo for SPI permissions, unless you've used Wiring Pi's gpio utility or otherwise adjusted device permissions.

API

spi = SPI.initialize(device)

device will usually be "/dev/spidev0.0" or "/dev/spidev0.0". You will first need to enable the spi-bcm2708 kernel module e.g. these instructions or similar for your platform. As mentioned above, by default this device requires root permissions and so you'll either need to change this or run your script with according privilege.

spi.clockSpeed([speed])

Sets (or gets, if no argument provided) the clock speed in Hz. Defaults to 4e6, i.e. 4MHz. The Pi only supports powers of 2 speeds and faster speeds might get derated a bit.

spi.dataMode([mode])

Sets (or gets, if no argument provided) the "data mode" (clock phase and polarity) to e.g. SPI.mode.CPHA | SPI.mode.CPOL. Default is no flags.

spi.bitOrder([order])

Sets (or gets, if no argument provided) the bit ordering. Default is SPI.order.MSB_FIRST or you can set SPI.order.LSB_FIRST.

Note that this is bit ordering, not bytes — byte ordering is up to your application.

spi.transfer(outbuffer, [incount,] cb)

Transfers data for the longer of outbuffer.length or incount bytes. If successfully, the second parameter to your callback will be a buffer of length incount (which defaults to outbuffer.length if not provided).

spi.read(incount, cb)

Collects incount bytes while writing as many \0 out.

spi.write(outbuffer, cb)

Writes outbuffer, ignoring response bytes.

Note that if there was an error opening the device, the transfer/read/write calls will fail each time called. I may revise the initialize method so to allow you to handle the error better.

spi.close(cb)

Frees up the underlying device descriptor if you are no longer using this instance. You will need to SPI.initialize a new instance if you wish to resume communication later.

License

Copyright © 2013–2019, Nathan Vander Wilt. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.

pi-spi's People

Contributors

jmstriegel avatar lukas-sturm avatar natevw avatar thiagorp avatar tobleminer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pi-spi's Issues

Error installing on Rasberry model 2

npm install pi-spi on my Raspberry Pi (model 2) running Raspbian

 npm install pi-spi
\
> [email protected] install /root/node_modules/pi-spi
> node-gyp rebuild

make: вход в каталог «/root/node_modules/pi-spi/build»
  CXX(target) Release/obj.target/spi_binding/spi_binding.o
In file included from ../spi_binding.cc:2:0:
../node_modules/nan/nan.h:324:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureHandleOrPersistent(const v8::Local<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) {
                           ^
../node_modules/nan/nan.h:319:17: note: ‘template<class T> v8::Handle<T> Nan::imp::NanEnsureHandleOrPersistent(v8::Handle<T>&)’ previously declared here
   v8::Handle<T> NanEnsureHandleOrPersistent(const v8::Handle<T> &val) {
                 ^
../node_modules/nan/nan.h:344:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(v8::Handle<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Handle<T> &val) {
                           ^
../node_modules/nan/nan.h:334:27: note: ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(const v8::Local<T>&)’ previously declared here
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Local<T> &val) {
                           ^
../node_modules/nan/nan.h:757:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:757:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:761:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:761:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:768:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:768:67: note: candidates are:
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../spi_binding.cc:2:
/root/.node-gyp/4.0.0/include/node/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/root/.node-gyp/4.0.0/include/node/node_buffer.h:31:40: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/root/.node-gyp/4.0.0/include/node/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/root/.node-gyp/4.0.0/include/node/node_buffer.h:43:40: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../spi_binding.cc:2:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:772:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), size)’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:779:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
../spi_binding.cc: In member function ‘virtual void SpiTransfer::Execute()’:
../spi_binding.cc:72:19: warning: missing initializer for member ‘spi_ioc_transfer::rx_nbits’ [-Wmissing-field-initializers]
                   };
                   ^
../spi_binding.cc:72:19: warning: missing initializer for member ‘spi_ioc_transfer::pad’ [-Wmissing-field-initializers]
../spi_binding.cc: In member function ‘virtual void SpiTransfer::HandleOKCallback()’:
../spi_binding.cc:125:43: warning: ‘void node::FatalException(const v8::TryCatch&)’ is deprecated (declared at /root/.node-gyp/4.0.0/include/node/node.h:282): Use FatalException(isolate, ...) [-Wdeprecated-declarations]
             node::FatalException(try_catch);
                                           ^
In file included from ../spi_binding.cc:2:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:769:3: warning: control reaches end of non-void function [-Wreturn-type]
   }
   ^
spi_binding.target.mk:88: ошибка выполнения рецепта для цели «Release/obj.target/spi_binding/spi_binding.o»
make: *** [Release/obj.target/spi_binding/spi_binding.o] Ошибка 1
make: выход из каталога «/root/node_modules/pi-spi/build»
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.1.10-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node_modules/pi-spi
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok
npm ERR! Linux 4.1.10-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "pi-spi"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pi-spi package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls pi-spi
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/npm-debug.log
npm install pi-spi  15,60s user 0,99s system 65% cpu 25,161 total

Add async initializer (which in turn bypasses queuing mess)

The current initialize method needs to be synchronous for "undisclosed reasons". [In short, so it can be ± compatible with another implementation that's not yet public.]

However, nothing precludes this implementation for detecting if a callback is passed in and doing different logic.

Error installing on Raspberry Pi

I get an error running npm install pi-spi on my Raspberry Pi (model B) running Raspbian.

Here's the error output

child_process: customFds option is deprecated, use stdio instead.
make: Entering directory '/home/dcox/workspace/projects/rosie/node_modules/pi-spi/build'
  CXX(target) Release/obj.target/spi_binding/spi_binding.o
../spi_binding.cc:18:1: error: ‘uv_mutex_t’ does not name a type
../spi_binding.cc:23:5: error: ‘uv_work_t’ does not name a type
../spi_binding.cc:36:16: error: variable or field ‘_Transfer’ declared void
../spi_binding.cc:36:16: error: ‘uv_work_t’ was not declared in this scope
../spi_binding.cc:36:27: error: ‘req’ was not declared in this scope
spi_binding.target.mk:81: recipe for target 'Release/obj.target/spi_binding/spi_binding.o' failed
make: *** [Release/obj.target/spi_binding/spi_binding.o] Error 1
make: Leaving directory '/home/dcox/workspace/projects/rosie/node_modules/pi-spi/build'

Am I possibly missing some system dependencies?

Error when trying to run on raspberry pi

I receive an error after using
npm install pi-spi

and trying to run my application.
This is the error:
module.js:337
throw new Error("Cannot find module '" + request + "'");
^
Error: Cannot find module './build/Release/spi_binding'
at Function._resolveFilename (module.js:337:11)
at Function._load (module.js:279:25)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at Object. (/home/pi/LightSwitch/node_modules/pi-spi/index.js:2:12)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:32)
at Function._load (module.js:311:12)
at Module.require (module.js:359:17)

raspberry pi 3b /dev/spidev0.1 will not be written

Hi,

I've encountered the issue, that if I use SPI.initialize('/dev/spidev0.1') the write / transfer output will be directed to spidev0.0.
I've tried initializing one and initializing before each transfer, none of it worked.

Any ideas, what went wrong?

Thanks.

Can't install on Beaglebone Black.

Hi, I'm not being able to install this library on my Beaglebone Black. Is it supposed to work on it?

I'm getting the following node-gyp error:

make: Entering directory `/var/lib/cloud9/node_modules/pi-spi/build'
  CXX(target) Release/obj.target/spi_binding/spi_binding.o
../spi_binding.cc: In function 'void Finish_Transfer(uv_work_t*, int)':
../spi_binding.cc:97:125: error: taking address of temporary array
../spi_binding.cc:103:103: error: taking address of temporary array
../spi_binding.cc:104:89: error: taking address of temporary array
../spi_binding.cc: In function 'v8::Handle<v8::Value> Transfer(const v8::Arguments&)':
../spi_binding.cc:164:81: error: invalid conversion from 'void (*)(uv_work_t*, int) {aka void (*)(uv_work_s*, int)}' to 'uv_after_work_cb {aka void (*)(uv_work_s*)}' [-fpermissive]
In file included from /home/root/.node-gyp/0.8.22/src/node.h:61:0,
                 from ../spi_binding.cc:1:
/home/root/.node-gyp/0.8.22/deps/uv/include/uv.h:1322:15: error:   initializing argument 4 of 'int uv_queue_work(uv_loop_t*, uv_work_t*, uv_work_cb, uv_after_work_cb)' [-fpermissive]
make: *** [Release/obj.target/spi_binding/spi_binding.o] Error 1
make: Leaving directory `/var/lib/cloud9/node_modules/pi-spi/build'

package.json version should be updated with every update

Thank you so much for this library. It does exactly what I need.

May I suggest you increment the version number in your top level package. This way users of your module can know if something changes and if these changes has been properly downloaded by npm or by github. Otherwise, one must look at the code in their repo to see if the code match what is in github.

By the way, I tested your version 1.0.1 with a 2 ways transfer on the raspberry with a 500kh clock with spi.mode.CPHA and it works. This 1.0.1 matches git 79243e2.

Error: SPI error: Inappropriate ioctl for device (errno 25)

Running this code:

var SPI = require('pi-spi');

var spi = new SPI.initialize('/dev/spidev1.1');

var data = new Uint8Array([
    255, 0, 0,
    255, 255, 255
]);

spi.write(new Buffer(data), function(err, d) {
    console.log(err, d);
});

Gives error and exits application.

Although running test from end of this page verifies that SPI interface works as supposed to.

Possible Memory Leak on Raspberry

Hello,
I am currently developing a control software for my LEDs and I am having some memory problems.
I am using the dotstar Library and that requires the pi-spi Library for communication with the SPI-Bus. (It can take any SPI-Lib it just needs to implement a write function)

I had my application running for some time and noticed that after some many hours the animations started to play super slow (1 update every 10 seconds) so I looked into the Problem.
I created some heapdumps at various points of memory usage (eg. after start, at 50%, etc.) but chrome-dev-tools always sad that my application needs arround 8.5 MB. Then I read that buffers are not "tracked" by the heapdump, so I thought it might be the heavy use of buffers in the ´dotstar´-Lib.
After some testing with my own code I saw that Node does not have problems with buffers. Then I thought it might be setInterval, but that was a false positive too.

Then I tested my own SPI-Lib (just a class that implements a write function that does nothing) and see there the memory usage didn't increase after some hours of letting it run.

So at that point I am quite sure it might be something with pi-spi. What do you guys think, is it possible that pi-spi causes the memory leak in my application?

I am using:

  • Adafruit Dotstar (ADA102-Chip)
  • Node: 9.9.0
  • Pi-SPI: 1.0.2
  • Raspberry Pi Zero W running Raspbian 9 Kernel 4.14

I also tried to find some other SPI-Libs for Node but can't seem to find one that fits my needs and node-spi is the same as pi-spi ?

I realy hope someone can help me on this 👍

Is pi-spi supports node v12.8.0 or node v10.16.0? gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/pi/aim/node_modules/pi-spi/.node-gyp'

pi@raspberrypi:~/aim $ sudo npm i --save pi-spi

[email protected] install /home/pi/aim/node_modules/pi-spi
node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/12.6.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/aim/node_modules/pi-spi/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/pi/aim/node_modules/pi-spi/.node-gyp'
gyp ERR! System Linux 4.19.50-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/aim/node_modules/pi-spi
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-06-20T17_15_32_544Z-debug.log

merge node-spi and pi-spi?

You seem to be doing much more SPI dev work with node than me (original author of node-spi). Most everything I do no longer uses spi, and I don't feel like maintaining node-spi any longer. Since you are already using NaN and support 4.x, should these two modules just merge (or rather, deprecate mine and just point people to yours?)

Reading from MCP3008

I'm trying to read a simple light resistor connected to a MCP3008, but I really don't know how to do it. The kernel module for SPI is working as I'm able to get the readings from python. Could you provide help or a simple code to do it? Thanks a lot!

warning installing on raspberry

[email protected] install /home/pi/share/expresstut/node_modules/pi-spi
node-gyp rebuild

make: Entering directory '/home/pi/share/expresstut/node_modules/pi-spi/build'
CXX(target) Release/obj.target/spi_binding/spi_binding.o
../spi_binding.cc: In member function ‘virtual void SpiTransfer::Execute()’:
../spi_binding.cc:72:19: warning: missing initializer for member ‘spi_ioc_transfer::rx_nbits’ [-Wmissing-field-initializers]
};
^
../spi_binding.cc:72:19: warning: missing initializer for member ‘spi_ioc_transfer::pad’ [-Wmissing-field-initializers]
SOLINK_MODULE(target) Release/obj.target/spi_binding.node
COPY Release/spi_binding.node
make: Leaving directory '/home/pi/share/expresstut/node_modules/pi-spi/build'
[email protected] node_modules/pi-spi
└── [email protected]

... happy to test the fix for this when you have it. Just let me know.

Incompatible with latest node.js?

I think the 0.10.x branch recently bumped up to the 0.11.x internal API, probably need some preprocessor stuff to deal with the differences.

Can't install from windows

I try install package with npm install from windows, but have a error: "\spi_binding.cc(66): fatal error C1021: invalid preprocessor command 'warning' [c:\UserData\git\Azure\node_modules\pi-spi\build\spi_binding.vcxproj]".
Part of log file:
error [email protected] install: node-gyp rebuild
84 error Exit status 1
85 error Failed at the [email protected] install script.
85 error This is most likely a problem with the pi-spi package,
85 error not with npm itself.
85 error Tell the author that this fails on your system:
85 error node-gyp rebuild
85 error You can get their info via:
85 error npm owner ls pi-spi
85 error There is likely additional logging output above.
86 error System Windows_NT 6.2.9200
87 error command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "pi-spi"
88 error cwd c:\UserData\git\Azure\spi
89 error node -v v0.10.26
90 error npm -v 1.4.3
91 error code ELIFECYCLE

Fix Build on Node 12

Currently pi-spi fails to build on Node.JS 12.x
Would be nice, if this could be fixed...

Fail to install stub on windows 10 platform

I believe the intention of your module is to install a non functioning stub on windows 10 environment.
pi-spi does not build and therefore does not install.

Microsoft Windows Version 10.0.10586 2015 Microsoft Corporation. All rights reserved.

C:\Users\John>node -v
v4.4.5

C:\Users\John>npm install natevw/pi-spi
|

[email protected] install C:\Users\John\node_modules\pi-spi
node-gyp rebuild

C:\Users\John\node_modules\pi-spi>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:356:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\John\node_modules\pi-spi
gyp ERR! node -v v4.4.5
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "natevw/pi-spi"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pi-spi package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pi-spi
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls pi-spi
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\John\npm-debug.log

C:\Users\John>


the npm-debug.log contains the following

[snipped] edit by @natevw — I moved this to a gist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.