Install fails with Node v23, due to `-std=c++17`.
Would it be possible to update binding.gyp, from -std=c++17 to -std=c++20 (or higher)?
A minimum of C++20 is required in Node 23:
https://github.com/nodejs/node/blob/9d2368f64329bf194c4e82b349e76fdad879d32a/deps/v8/include/v8config.h#L13
Without it, building tree-sitter will fail.
this should be easily solved in changing in binding.gyp all c++17 to c++20 @amaanq
But note that upgrading the C++ std version can prevent usage with older OS/compilers and versions of Node.js... This is something/another thing Node.js/v8 doesn't handle that well IMHO...
I forked and released my own version, which fixes existing issues and works fine. I hope it helps.
https://www.npmjs.com/package/@keqingmoe/tree-sitter
Hi, I don't know which older node versions you support but for these parts:
https://github.com/tree-sitter/node-tree-sitter/blob/c84d48d35d06d540cef0e3381c12b079c64454a1/binding.gyp#L27-L47
Why don't you just use the default configuration from node's common.gypi? If you use that, the nodejs install will supply the c++ version.
Why don't you just use the default configuration from node's common.gypi? If you use that, the nodejs install will supply the c++ version.
Nevermind, looks like node doesn't have a proper version in their config.gypi and common.gypi.
Nevermind, looks like node doesn't have a proper version in their config.gypi and common.gypi.
😅
I realized I could run a diff between versions... and yeah, there is a difference: node_module_version variable changes across versions!
| nodejs version | node_module_version |
|---|---|
| 22 | 127 |
| 23 | 131 |
| 24 | 137 |
I didn't notice before because I was looking between 22 & 24, which had only one digit change. Sorry!