fivdi / pigpio

Fast GPIO, PWM, servo control, state change notification and interrupt handling with Node.js on the Raspberry Pi
MIT License
943 stars 89 forks source link

Error: The module '.../pigpio.node' was compiled against a different Node.js version #134

Closed Zeprakadebra closed 3 years ago

Zeprakadebra commented 3 years ago

Hi fivdi,

when including your module into my node.js code I get the following error message:

0|mm | Error: The module '/home/pi/.../node_modules/pigpio/build/Release/pigpio.node' 0|mm | was compiled against a different Node.js version using 0|mm | NODE_MODULE_VERSION 64. This version of Node.js requires 0|mm | NODE_MODULE_VERSION 85. Please try re-compiling or re-installing

Can you please let me know how I can solve this issue? Or can you please offer me a re-compiled version of your module against Node.js Version 85?

Kind regards,

Zebrakadebra

fivdi commented 3 years ago

This issue is not related to pigpio. It's related to the version of Node.js that was used when pigpio was installed and the version of Node.js that is being used at runtime by applications using pigpio.

NODE_MODULE_VERSION 64 implies Node.js v10 was used when pigpio was installed. There is no version of Node.js that uses NODE_MODULE_VERSION 85. See here.

Are you by any chance using Electron? If so, see Using Native Node Modules.

Zeprakadebra commented 3 years ago

Hi fivdi, thanks for your quick and quality reply. All good to know.

You are right: my code is embedded into electron, but to be honest i am still learning how to understand it.

So I am going to check your link regarding the native modules and then i let know my progress on that.

Kind regards, Zebrakadebra

Zeprakadebra commented 3 years ago

Hi fivdi, The instructions for Using Native Node Modules worked perfectly for me. Thanks a lot for your hints. This issue can be closed. Kind regards, Zebrakadebra

fivdi commented 3 years ago

@Zeprakadebra That's good News. Thanks for the feedback.