Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue Sep 10, 2023 · 7 comments

Comments

@TrevorBlythe
Copy link

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
Copy link
Member

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
Copy link
Author

How do I rebuild it from source?

@dhritzkiv
Copy link
Member

It will happen automatically when you reinstall it with npm.

You can also run npm rebuild gl

@dmt0
Copy link

dmt0 commented Sep 15, 2023

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
Copy link
Author

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
Copy link
Member

dhritzkiv commented Sep 16, 2023 via email

@xeoshow
Copy link

xeoshow commented Feb 28, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants