I have a raspberry with a breadboard and a button connected to the breadboard. I am running this simple Node.js program on Raspbian:

var GPIO = require('onoff').Gpio,
    button = new GPIO(17, 'in', 'both');

button.watch(function(err, value){
    console.log('button pressed');

I also used:

gpio-admin export 17
gpio-admin export 18
gpio-admin export 21

Whenever I pressed the button, it would console.log and the program worked perfectly. The problem is that I didn't use it for a few days and next time I turn the raspberry pi on, the same program would throw this error whenever you press the button:

node: symbol lookup error: /home/pi/learn/new/node_modules/onoff/node_modules/epoll/build/Release/epoll.node: undefined symbol: _ZN4node12MakeCallbackEN2v86HandleINS0_6ObjectEEENS1_INS0_8FunctionEEEiPNS1_INS0_5ValueEEE

I have tried reinstalling the 'onoff' dependency, I have tried running the same program, still no success.

I need to mention that the hardware has not been touched since it worked last time. If I am trying to light an LED, it's fine. It's only the button that throws the error.

Any idea how to fix this?

  • I am seeing this too. Did you ever find a solution? – user35441 Oct 5 '15 at 18:29
  • Sorry, I still haven't figured that out. – Roco CTZ Oct 6 '15 at 6:47

I had the same issue. You may have to upgrade nodejs and npm. Once done, reinstall onoff.

Hope it helps. Here is the link to my resolution in github :


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.