soarez / node-wiring-pi

Node.js bindings to wiringPi
86 stars 128 forks source link

build error when installing on RP2 #5

Closed jguillod closed 9 years ago

jguillod commented 9 years ago

When executing npm install wiring-pi on a Raspberry PI 2 the following log contained error

pi@raspberrypi ~ $ npm install wiring-pi npm WARN package.json gpio-stream@1.0.14 No repository field.

wiring-pi@2.0.0 install /home/pi/node_modules/wiring-pi /bin/bash ./install.sh

Cloning libWiringPi ... done. patching file ./wiringpi/devLib/Makefile patching file ./wiringpi/gpio/Makefile Making libWiringPi ... done. Making devLib ...done. Unistalling gpio utility ... done. Making gpio utility ... done. Installing gpio utility ... done. Making wiring-pi ... child_process: customFds option is deprecated, use stdio instead. make: Entering directory '/home/pi/node_modules/wiring-pi/build' CXX(target) Release/obj.target/wiringPi/src/addon.o ../src/addon.cc: In function ‘void throwerror(const char, ...)’: ../src/addon.cc:30:3: error: ‘ThrowException’ is not a member of ‘v8’ ../src/addon.cc:30:43: error: ‘New’ is not a member of ‘v8::String’ wiringPi.target.mk:126: recipe for target 'Release/obj.target/wiringPi/src/addon.o' failed make: _\ [Release/obj.target/wiringPi/src/addon.o] Error 1 make: Leaving directory '/home/pi/node_modules/wiring-pi/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:267:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067:12) gyp ERR! System Linux 3.18.14-v7+ gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/pi/node_modules/wiring-pi gyp ERR! node -v v0.12.0 gyp ERR! node-gyp -v v1.0.2 gyp ERR! not ok done. Enjoy ! wiring-pi@2.0.0 node_modules/wiring-pi

And the module cannot be loaded in node:

pi@raspberrypi ~ $ node

var wpi = require('wiring-pi'); Error: Cannot find module '../build/Release/wiringPi' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/home/pi/node_modules/wiring-pi/lib/exports.js:1:80) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17)

any clue?

Thanks

MetinSeylan commented 9 years ago

have same problem :(

soarez commented 9 years ago

Sorry folks, I haven't maintained this project properly for a long time. The repository you're looking for is this awesome fork — https://github.com/eugeneware/wiring-pi

Please submit your issues there where you'll find better help, I don't own a RPi2, so I can't help.

However, from looking at the logs @jguillod posted, my first guess would be a node version mismatch, make sure you're using Node v0.10.

kjayasa commented 8 years ago

I had the same problem. I did not have git installed. After I installed git it worked.