natevw / pi-spi

Simple RasPi SPI library (node.js)
93 stars 14 forks source link

Error installing on Raspberry Pi #14

Closed losttime closed 9 years ago

losttime commented 9 years ago

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?

losttime commented 9 years ago

I believe I have the dependencies for node-gyp, according to https://www.npmjs.com/package/node-gyp

$ python --version
Python 2.7.3
$ gcc --version
gcc (Debian 4.6.3-14+rpi1) 4.6.3
...
$ make --version
GNU Make 4.0
Built for arm-unknown-linux-gnueabihf
...
natevw commented 9 years ago

What version of node? This module likely only works with node 0.10.x at the moment and will need an update for newer versions of v8/libuv — sorry this is not specified via package.json engines.

I intend to update this (or happy for PR migrating it to use https://github.com/rvagg/nan instead of direct bindings) but haven't messed with the various options for node beyond v0.10 myself yet.

losttime commented 9 years ago

I see. I'm running 0.12.0.

losttime commented 9 years ago

I can confirm that it does install just fine with node 0.10.28. Thanks :)

natevw commented 9 years ago

Glad downgrading was an option for you! Hoping to update soon since 0.12 has been out for a while, just haven't quite dared update my main development machine to it and so it's been a bit off my radar.

natevw commented 9 years ago

I think I've fixed node 0.12.x compatibility with https://github.com/natevw/pi-spi/pull/15. (Will release once I can test on hardware…)

You can test via npm install git://github.com/natevw/pi-spi.git#nan_compat though if you're interested.

natevw commented 9 years ago

pi-spi@1.0.0 should be compatible with either version of node (and probably iojs too…)

losttime commented 9 years ago

Thanks for moving on this so quickly! :+1: