stackgl / headless-gl

🎃 Windowless WebGL for node.js
1.73k stars 166 forks source link

Compiled against a different Node.js version using NODE_MODULE_VERSION 108. This version of Node.js requires NODE_MODULE_VERSION 115. #266

Closed TrevorBlythe closed 9 months ago

TrevorBlythe commented 10 months ago

Trying to use require('gl') gives error,

Error: The module 'my project/node_modules/gl/build/Release/webgl.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 108. This version of Node.js requires NODE_MODULE_VERSION 115.

What does this mean?? Please help!

I am using node version 20.3.1 I also tried it on the bun runtime but it failed there too.

dhritzkiv commented 10 months ago

This usually means that you installed headless-gl under an older Node.js (v18, for example), then updated Node.js to v20. Usually the fix is rebuilding headless-gl with npm, or simply removing and reinstalling headless-gl with npm.

Note: headless-gl does not currently have prebuilt binaries for v20 of Node, so it may take some time to build from source on your machine.

TrevorBlythe commented 10 months ago

How do I rebuild it from source?

dhritzkiv commented 10 months ago

It will happen automatically when you reinstall it with npm.

You can also run npm rebuild gl

dmt0 commented 9 months ago

Could we have a prebuilt binary for Node 20? 😊 It seems non-trivial to build it either on my dev setup or in my CI. I suppose I'd need to install python 2.7 on both.

Node 16 just EOLed. It's a ripe time for upgrading. I'm sure many people are jumping straight to V20 right about now.

TrevorBlythe commented 9 months ago

It will happen automatically when you reinstall it with npm.

You can also run npm rebuild gl

First of all, thank you for replying and I did get it working eventually. I also agree that there should just be a pre built binary since its so easy to compile.

dhritzkiv commented 9 months ago

It’s on my list; when I tried to produce a prebuilt build for v20 early on, I ran into CI issues.On 15 Sep 2023, at 19:36, Trevor Blythe @.***> wrote:

It will happen automatically when you reinstall it with npm. You can also run npm rebuild gl

First of all, thank you for replying and I did get it working eventually. I also agree that there should just be a pre built binary since its so easy to compile.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

xeoshow commented 4 months ago

Hello,

I also met the same problem, and it is also the same error when using "npm rebuild gl". I am using this under electron. Any update for this now? Thanks a lot.