tree-sitter / node-tree-sitter

Node.js bindings for tree-sitter
https://www.npmjs.com/package/tree-sitter
MIT License
649 stars 114 forks source link

Fail to build on Node 14 (when trying to update `npm` package with `yarn`) #78

Closed edouard-lopez closed 1 year ago

edouard-lopez commented 3 years ago

Trying to upgrade my npm CLI I got a build error on tree-sitter. I tried to update the package itself but with the same result

OS

  NAME="Linux Mint"
  ID=linuxmint
  ID_LIKE=ubuntu
  VERSION_ID="20.1"
  VERSION_CODENAME=ulyssa
  UBUNTU_CODENAME=focal

Node & NPM

❯ node --version
v14.16.0

❯ npm --version
6.14.11

Error log

yarn global add tree-sitter &> ~/error.txt
yarn global v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "@vue/cli > @vue/cli-ui > graphql-tag@2.10.0" has unmet peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0".
warning "@vue/cli > @vue/cli-ui > graphql-type-json@0.2.1" has unmet peer dependency "graphql@>=0.8.0".
warning "@vue/cli > @vue/cli-ui > vue-cli-plugin-apollo > apollo-server-express > @apollographql/apollo-upload-server@5.0.3" has incorrect peer dependency "graphql@^0.13.1".
warning " > eslint-plugin-import@2.19.1" has unmet peer dependency "eslint@2.x - 6.x".
[4/4] Building fresh packages...
error /home/ed8/.local/share/yarn/global/node_modules/bash-language-server/node_modules/tree-sitter: Command failed.
Exit code: 1
Command: prebuild-install || node-gyp rebuild
Arguments: 
Directory: /home/ed8/.local/share/yarn/global/node_modules/bash-language-server/node_modules/tree-sitter
Output:
prebuild-install WARN install No prebuilt binaries found (target=14.16.0 runtime=node arch=x64 libc= platform=linux)
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.16.0 | linux | x64
gyp info find Python using Python version 3.8.5 found at "/usr/bin/python"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/ed8/.local/share/yarn/global/node_modules/bash-language-server/node_modules/tree-sitter/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/ed8/.cache/node-gyp/14.16.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/ed8/.cache/node-gyp/14.16.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/ed8/.cache/node-gyp/14.16.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/ed8/.local/share/yarn/global/node_modules/bash-language-server/node_modules/tree-sitter',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/ed8/.local/share/yarn/global/node_modules/bash-language-server/node_modules/tree-sitter/build'
  CC(target) Release/obj.target/runtime/vendor/tree-sitter/src/runtime/get_changed_ranges.o
  CC(target) Release/obj.target/runtime/vendor/tree-sitter/src/runtime/language.o
  CC(target) Release/obj.target/runtime/vendor/tree-sitter/src/runtime/lexer.o
  CC(target) Release/obj.target/runtime/vendor/tree-sitter/src/runtime/node.o
  CC(target) Release/obj.target/runtime/vendor/tree-sitter/src/runtime/stack.o
  CC(target) Release/obj.target/runtime/vendor/tree-sitter/src/runtime/parser.o
  CC(target) Release/obj.target/runtime/vendor/tree-sitter/src/runtime/subtree.o
  CC(target) Release/obj.target/runtime/vendor/tree-sitter/src/runtime/tree.o
  CC(target) Release/obj.target/runtime/vendor/tree-sitter/src/runtime/tree_cursor.o
  CC(target) Release/obj.target/runtime/vendor/tree-sitter/src/runtime/utf16.o
  CC(target) Release/obj.target/runtime/vendor/tree-sitter/externals/utf8proc/utf8proc.o
  AR(target) Release/obj.target/vendor/tree-sitter/runtime.a
  COPY Release/runtime.a
  CXX(target) Release/obj.target/tree_sitter_runtime_binding/src/binding.o
In file included from ../src/./node.h:4,
                 from ../src/binding.cc:3:
../../../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../../../nan/nan.h:2232:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2232 |     , reinterpret_cast(AsyncExecuteComplete)
      |                                                              ^
In file included from ../src/binding.cc:1:
../src/binding.cc: At global scope:
/home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:758:43: warning: cast between incompatible function types from ‘void (*)(v8::Local)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local, v8::Local, void*)’} [-Wcast-function-type]
  758 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:792:3: note: in expansion of macro ‘NODE_MODULE_X’
  792 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/binding.cc:21:1: note: in expansion of macro ‘NODE_MODULE’
   21 | NODE_MODULE(tree_sitter_runtime_binding, InitAll)
      | ^~~~~~~~~~~
  CXX(target) Release/obj.target/tree_sitter_runtime_binding/src/conversions.o
In file included from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
../../../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../../../nan/nan.h:2232:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2232 |     , reinterpret_cast(AsyncExecuteComplete)
      |                                                              ^
../src/conversions.cc: In function ‘void node_tree_sitter::InitConversions(v8::Local)’:
../src/conversions.cc:31:118: warning: ‘static v8::Local v8::ArrayBuffer::New(v8::Isolate*, void*, size_t, v8::ArrayBufferCreationMode)’ is deprecated: Use the version that takes a BackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
   31 |   auto js_point_transfer_buffer = ArrayBuffer::New(Isolate::GetCurrent(), point_transfer_buffer, 2 * sizeof(uint32_t));
      |                                                                                                                      ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:5176:29: note: declared here
 5176 |   static Local New(
      |                             ^~~
../src/conversions.cc:31:118: warning: ‘static v8::Local v8::ArrayBuffer::New(v8::Isolate*, void*, size_t, v8::ArrayBufferCreationMode)’ is deprecated: Use the version that takes a BackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
   31 |   auto js_point_transfer_buffer = ArrayBuffer::New(Isolate::GetCurrent(), point_transfer_buffer, 2 * sizeof(uint32_t));
      |                                                                                                                      ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:5176:29: note: declared here
 5176 |   static Local New(
      |                             ^~~
../src/conversions.cc:32:113: error: no matching function for call to ‘v8::Object::Set(v8::Local, v8::Local)’
   32 |   exports->Set(Nan::New("pointTransferArray").ToLocalChecked(), Uint32Array::New(js_point_transfer_buffer, 0, 2));
      |                                                                                                                 ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, v8::Local, v8::Local)’
 3670 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, uint32_t, v8::Local)’
 3673 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/conversions.cc: In function ‘v8::Local node_tree_sitter::RangeToJS(const TSRange&)’:
../src/conversions.cc:42:73: error: no matching function for call to ‘v8::Object::Set(v8::Local, v8::Local)’
   42 |   result->Set(Nan::New(start_position_key), PointToJS(range.start_point));
      |                                                                         ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, v8::Local, v8::Local)’
 3670 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, uint32_t, v8::Local)’
 3673 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/conversions.cc:43:73: error: no matching function for call to ‘v8::Object::Set(v8::Local, v8::Local)’
   43 |   result->Set(Nan::New(start_index_key), ByteCountToJS(range.start_byte));
      |                                                                         ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, v8::Local, v8::Local)’
 3670 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, uint32_t, v8::Local)’
 3673 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/conversions.cc:44:69: error: no matching function for call to ‘v8::Object::Set(v8::Local, v8::Local)’
   44 |   result->Set(Nan::New(end_position_key), PointToJS(range.end_point));
      |                                                                     ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, v8::Local, v8::Local)’
 3670 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, uint32_t, v8::Local)’
 3673 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/conversions.cc:45:69: error: no matching function for call to ‘v8::Object::Set(v8::Local, v8::Local)’
   45 |   result->Set(Nan::New(end_index_key), ByteCountToJS(range.end_byte));
      |                                                                     ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, v8::Local, v8::Local)’
 3670 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, uint32_t, v8::Local)’
 3673 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/conversions.cc: In function ‘Nan::Maybe node_tree_sitter::RangeFromJS(const v8::Local&)’:
../src/conversions.cc:60:50: error: no matching function for call to ‘v8::Object::Get(v8::Local)’
   60 |     auto field = Type(js_range->Get(Nan::New(key))); \
      |                                                  ^
../src/conversions.cc:68:3: note: in expansion of macro ‘INIT’
   68 |   INIT(start_point, start_position_key, PointFromJS);
      |   ^~~~
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, v8::Local)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/conversions.cc:60:50: error: no matching function for call to ‘v8::Object::Get(v8::Local)’
   60 |     auto field = Type(js_range->Get(Nan::New(key))); \
      |                                                  ^
../src/conversions.cc:69:3: note: in expansion of macro ‘INIT’
   69 |   INIT(end_point, end_position_key, PointFromJS);
      |   ^~~~
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, v8::Local)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/conversions.cc:60:50: error: no matching function for call to ‘v8::Object::Get(v8::Local)’
   60 |     auto field = Type(js_range->Get(Nan::New(key))); \
      |                                                  ^
../src/conversions.cc:70:3: note: in expansion of macro ‘INIT’
   70 |   INIT(start_byte, start_index_key, ByteCountFromJS);
      |   ^~~~
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, v8::Local)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/conversions.cc:60:50: error: no matching function for call to ‘v8::Object::Get(v8::Local)’
   60 |     auto field = Type(js_range->Get(Nan::New(key))); \
      |                                                  ^
../src/conversions.cc:71:3: note: in expansion of macro ‘INIT’
   71 |   INIT(end_byte, end_index_key, ByteCountFromJS);
      |   ^~~~
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, v8::Local)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/conversions.cc: In function ‘v8::Local node_tree_sitter::PointToJS(const TSPoint&)’:
../src/conversions.cc:80:61: error: no matching function for call to ‘v8::Object::Set(v8::Local, Nan::imp::FactoryBase::return_t)’
   80 |   result->Set(Nan::New(row_key), Nan::New(point.row));
      |                                                             ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, v8::Local, v8::Local)’
 3670 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, uint32_t, v8::Local)’
 3673 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/conversions.cc:81:64: error: no matching function for call to ‘v8::Object::Set(v8::Local, v8::Local)’
   81 |   result->Set(Nan::New(column_key), ByteCountToJS(point.column));
      |                                                                ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, v8::Local, v8::Local)’
 3670 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Local, uint32_t, v8::Local)’
 3673 |   V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
      |                                     ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
../src/conversions.cc: In function ‘Nan::Maybe node_tree_sitter::PointFromJS(const v8::Local&)’:
../src/conversions.cc:92:56: error: no matching function for call to ‘v8::Object::Get(v8::Local)’
   92 |   Local js_row = js_point->Get(Nan::New(row_key));
      |                                                        ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, v8::Local)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/conversions.cc:98:62: error: no matching function for call to ‘v8::Object::Get(v8::Local)’
   98 |   Local js_column = js_point->Get(Nan::New(column_key));
      |                                                              ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, v8::Local)’
 3717 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3717:43: note:   candidate expects 2 arguments, 1 provided
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note: candidate: ‘v8::MaybeLocal v8::Object::Get(v8::Local, uint32_t)’
 3720 |   V8_WARN_UNUSED_RESULT MaybeLocal Get(Local context,
      |                                           ^~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:3720:43: note:   candidate expects 2 arguments, 1 provided
../src/conversions.cc:105:41: error: no matching function for call to ‘v8::Value::NumberValue()’
  105 |   if (std::isfinite(js_row->NumberValue())) {
      |                                         ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:2861:39: note: candidate: ‘v8::Maybe v8::Value::NumberValue(v8::Local) const’
 2861 |   V8_WARN_UNUSED_RESULT Maybe NumberValue(Local context) const;
      |                                       ^~~~~~~~~~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:2861:39: note:   candidate expects 1 argument, 0 provided
../src/conversions.cc:106:52: error: no matching function for call to ‘v8::Value::Int32Value()’
  106 |     row = static_cast(js_row->Int32Value());
      |                                                    ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:2869:40: note: candidate: ‘v8::Maybe v8::Value::Int32Value(v8::Local) const’
 2869 |   V8_WARN_UNUSED_RESULT Maybe Int32Value(Local context) const;
      |                                        ^~~~~~~~~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:2869:40: note:   candidate expects 1 argument, 0 provided
../src/conversions.cc:111:44: error: no matching function for call to ‘v8::Value::NumberValue()’
  111 |   if (std::isfinite(js_column->NumberValue())) {
      |                                            ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:2861:39: note: candidate: ‘v8::Maybe v8::Value::NumberValue(v8::Local) const’
 2861 |   V8_WARN_UNUSED_RESULT Maybe NumberValue(Local context) const;
      |                                       ^~~~~~~~~~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:2861:39: note:   candidate expects 1 argument, 0 provided
../src/conversions.cc:112:58: error: no matching function for call to ‘v8::Value::Int32Value()’
  112 |     column = static_cast(js_column->Int32Value()) * BYTES_PER_CHARACTER;
      |                                                          ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:2869:40: note: candidate: ‘v8::Maybe v8::Value::Int32Value(v8::Local) const’
 2869 |   V8_WARN_UNUSED_RESULT Maybe Int32Value(Local context) const;
      |                                        ^~~~~~~~~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:2869:40: note:   candidate expects 1 argument, 0 provided
../src/conversions.cc: In function ‘Nan::Maybe node_tree_sitter::ByteCountFromJS(const v8::Local&)’:
../src/conversions.cc:130:47: error: no matching function for call to ‘v8::Value::Uint32Value()’
  130 |   return Nan::Just(arg->Uint32Value() * BYTES_PER_CHARACTER);
      |                                               ^
In file included from /home/ed8/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from ../../../../nan/nan.h:53,
                 from ../src/./node.h:4,
                 from ../src/conversions.cc:1:
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:2866:41: note: candidate: ‘v8::Maybe v8::Value::Uint32Value(v8::Local) const’
 2866 |   V8_WARN_UNUSED_RESULT Maybe Uint32Value(
      |                                         ^~~~~~~~~~~
/home/ed8/.cache/node-gyp/14.16.0/include/node/v8.h:2866:41: note:   candidate expects 1 argument, 0 provided
make: *** [tree_sitter_runtime_binding.target.mk:128: Release/obj.target/tree_sitter_runtime_binding/src/conversions.o] Error 1
make: Leaving directory '/home/ed8/.local/share/yarn/global/node_modules/bash-language-server/node_modules/tree-sitter/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 5.4.0-65-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ed8/.local/share/yarn/global/node_modules/bash-language-server/node_modules/tree-sitter
gyp ERR! node -v v14.16.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

gpetrov commented 3 years ago

Any news on this @maxbrunsfeld ? Currently tree-sitter can't build on Node 14

The fork from https://github.com/sergei-dyshel/node-tree-sitter/commit/961870e07d395c8000a27051b01e01d6cecf7e9b already have most of the fixes ...

verhovsky commented 1 year ago

This was fixed by #95

Please re-open the issue if you're still having issues.