WiringPi / WiringPi-Node

Node.js bindings to wiringPi
334 stars 94 forks source link

Error: Module did not self-register #41

Closed dislick closed 8 years ago

dislick commented 8 years ago

Hi!

I successfully installed wiring-pi on a Raspberry 2 Model B, but as soon as I try to use the library it throws the following error:

module.js:434
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: Module did not self-register.
    at Error (native)
    at Object.Module._extensions..node (module.js:434:18)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/pi/raspberry-realtime-test/node_modules/wiring-pi/lib/exports.js:1:80)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)

Here is the file test.js I'm trying to execute: sudo node test.js

var wpi = require('wiring-pi');

How can I resolve this issue?

Program Version
node 4.4.2
npm 1.4.21
gcc 4.9.2
dislick commented 8 years ago

Fixed the issue by using a newer NPM version! Sorry for the trouble.