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

Yarn install fails in Node 12 #3799

Closed
nicholas-l opened this issue Oct 29, 2019 · 4 comments · Fixed by #3812
Closed

Yarn install fails in Node 12 #3799

nicholas-l opened this issue Oct 29, 2019 · 4 comments · Fixed by #3812
Assignees

Comments

@nicholas-l
Copy link

Environment

  • Package version(s): develop branch
  • Browser and OS versions: Ubuntu 19.10, Node 13

If possible, link to a minimal repro (fork this code sandbox):

Steps to reproduce

  1. Clone git repo
  2. Run yarn install

Actual behavior

Deps install fails due to tree-sitter-typescript failing to build. I am not sure if that package is actually the problem or the version of nan or node-gyp being pulled in by yarn hoisting. Is anyone else having this problem?

Build Log
[4/4] Rebuilding all packages...
[-/8] ⢀ waiting...


Error: /home/nicholas/Development/blueprint/node_modules/tree-sitter-typescript: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/nicholas/Development/blueprint/node_modules/tree-sitter-typescript
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args   '/home/nicholas/Development/blueprint/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/nicholas/Development/blueprint/node_modules/tree-sitter-typescript/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/nicholas/Development/blueprint/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/nicholas/.node-gyp/13.0.1/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/nicholas/.node-gyp/13.0.1',
gyp info spawn args   '-Dnode_gyp_dir=/home/nicholas/Development/blueprint/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/nicholas/.node-gyp/13.0.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/nicholas/Development/blueprint/node_modules/tree-sitter-typescript',
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/nicholas/Development/blueprint/node_modules/tree-sitter-typescript/build'
  CC(target) Release/obj.target/tree_sitter_tsx_binding/tsx/src/parser.o
  CC(target) Release/obj.target/tree_sitter_tsx_binding/tsx/src/scanner.o
  CXX(target) Release/obj.target/tree_sitter_tsx_binding/tsx/src/binding.o
In file included from ../tsx/src/binding.cc:3:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298: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]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../tsx/src/binding.cc: At global scope:
../tsx/src/binding.cc:13:11: error: variable or field ‘Init’ declared void
   13 | void Init(Handle<Object> exports, Handle<Object> module) {
      |           ^~~~~~
../tsx/src/binding.cc:13:11: error: ‘Handle’ was not declared in this scope
../tsx/src/binding.cc:13:24: error: expected primary-expression before ‘>’ token
   13 | void Init(Handle<Object> exports, Handle<Object> module) {
      |                        ^
../tsx/src/binding.cc:13:26: error: ‘exports’ was not declared in this scope
   13 | void Init(Handle<Object> exports, Handle<Object> module) {
      |                          ^~~~~~~
../tsx/src/binding.cc:13:35: error: ‘Handle’ was not declared in this scope
   13 | void Init(Handle<Object> exports, Handle<Object> module) {
      |                                   ^~~~~~
../tsx/src/binding.cc:13:48: error: expected primary-expression before ‘>’ token
   13 | void Init(Handle<Object> exports, Handle<Object> module) {
      |                                                ^
../tsx/src/binding.cc:13:50: error: ‘module’ was not declared in this scope
   13 | void Init(Handle<Object> exports, Handle<Object> module) {
      |                                                  ^~~~~~
In file included from ../tsx/src/binding.cc:2:
../tsx/src/binding.cc:26:38: error: ‘Init’ was not declared in this scope; did you mean ‘node::Init’?
   26 | NODE_MODULE(tree_sitter_tsx_binding, Init)
      |                                      ^~~~
/home/nicholas/.node-gyp/13.0.1/include/node/node.h:571:36: note: in definition of macro ‘NODE_MODULE_X’
  571 |       (node::addon_register_func) (regfunc),                          \
      |                                    ^~~~~~~
../tsx/src/binding.cc:26:1: note: in expansion of macro ‘NODE_MODULE’
   26 | NODE_MODULE(tree_sitter_tsx_binding, Init)
      | ^~~~~~~~~~~
/home/nicholas/.node-gyp/13.0.1/include/node/node.h:223:18: note: ‘node::Init’ declared here
  223 | NODE_EXTERN void Init(int* argc,
      |                  ^~~~
In file included from /home/nicholas/.node-gyp/13.0.1/include/node/node.h:63,
                 from ../tsx/src/binding.cc:2:
/home/nicholas/.node-gyp/13.0.1/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/nicholas/.node-gyp/13.0.1/include/node/node_object_wrap.h:84:78:   required from here
/home/nicholas/.node-gyp/13.0.1/include/node/v8.h:10092:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
10092 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/nicholas/.node-gyp/13.0.1/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61:   required from here
/home/nicholas/.node-gyp/13.0.1/include/node/v8.h:10092:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
In file included from ../tsx/src/binding.cc:3:
../tsx/src/binding.cc:11:12: warning: ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::New(Nan::NAN_METHOD_ARGS_TYPE)’ defined but not used [-Wunused-function]
   11 | NAN_METHOD(New) {}
      |            ^~~
../../nan/nan.h:1566:33: note: in definition of macro ‘NAN_METHOD’
 1566 |     Nan::NAN_METHOD_RETURN_TYPE name(Nan::NAN_METHOD_ARGS_TYPE info)
      |                                 ^~~~
make: *** [tree_sitter_tsx_binding.target.mk:115: Release/obj.target/tree_sitter_tsx_binding/tsx/src/binding.o] Error 1
make: Leaving directory '/home/nicholas/Development/blueprint/node_modules/tree-sitter-typescript/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/nicholas/Development/blueprint/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 5.3.0-19-generic
gyp ERR! command "/usr/bin/node" "/home/nicholas/Development/blueprint/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /home/nicholas/Development/blueprint/node_modules/tree-sitter-typescript
gyp ERR! node -v v13.0.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
    at ProcessTermError.ExtendableBuiltin (/usr/share/yarn/lib/cli.js:721:66)
    at ProcessTermError.MessageError (/usr/share/yarn/lib/cli.js:750:123)
    at new ProcessTermError (/usr/share/yarn/lib/cli.js:790:113)
    at ChildProcess.<anonymous> (/usr/share/yarn/lib/cli.js:25884:17)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1028:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Expected behavior

Install deps for monorepo.

Possible solution

I think yarns's workspace hoisting is interfering with versions that are compatible with node 13. Maybe an update for one of the deps would fix it?

@adidahiya
Copy link
Contributor

I haven't tested with Node 13 yet. We run CI on Node LTS, and that's our main priority. I'm open to PRs which fix compatibility with latest Node, though

@nicholas-l
Copy link
Author

nicholas-l commented Oct 31, 2019

Looks like it also fails on Node 12.10 in that linked issue and I can confirm it also failed on Node 12.12 (LTS) on Catalina.

Build log
[5/5] 🔨  Building fresh packages...
[-/8] ⢀ waiting...
[-/8] ⠠ waiting...
[-/8] ⠠ waiting...
[7/8] ⠠ oniguruma
error /Users/nicholas/Development/blueprint/node_modules/tree-sitter-typescript: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/nicholas/Development/blueprint/node_modules/tree-sitter-typescript
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn /usr/local/bin/python2
gyp info spawn args [
gyp info spawn args   '/Users/nicholas/Development/blueprint/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   '/Users/nicholas/Development/blueprint/node_modules/tree-sitter-typescript/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/nicholas/Development/blueprint/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/nicholas/.node-gyp/12.12.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=/Users/nicholas/.node-gyp/12.12.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/nicholas/Development/blueprint/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/nicholas/.node-gyp/12.12.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/nicholas/Development/blueprint/node_modules/tree-sitter-typescript',
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' ]
  CC(target) Release/obj.target/tree_sitter_tsx_binding/tsx/src/parser.o
  CC(target) Release/obj.target/tree_sitter_tsx_binding/tsx/src/scanner.o
  CXX(target) Release/obj.target/tree_sitter_tsx_binding/tsx/src/binding.o
../tsx/src/binding.cc:13:6: error: variable has incomplete type 'void'
void Init(Handle<Object> exports, Handle<Object> module) {
     ^
../tsx/src/binding.cc:13:11: error: use of undeclared identifier 'Handle'
void Init(Handle<Object> exports, Handle<Object> module) {
          ^
../tsx/src/binding.cc:13:18: error: 'Object' does not refer to a value
void Init(Handle<Object> exports, Handle<Object> module) {
                 ^
/Users/nicholas/.node-gyp/12.12.0/include/node/v8.h:3400:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../tsx/src/binding.cc:13:26: error: use of undeclared identifier 'exports'
void Init(Handle<Object> exports, Handle<Object> module) {
                         ^
../tsx/src/binding.cc:13:35: error: use of undeclared identifier 'Handle'
void Init(Handle<Object> exports, Handle<Object> module) {
                                  ^
../tsx/src/binding.cc:13:42: error: 'Object' does not refer to a value
void Init(Handle<Object> exports, Handle<Object> module) {
                                         ^
/Users/nicholas/.node-gyp/12.12.0/include/node/v8.h:3400:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../tsx/src/binding.cc:13:50: error: use of undeclared identifier 'module'
void Init(Handle<Object> exports, Handle<Object> module) {
                                                 ^
../tsx/src/binding.cc:13:57: error: expected ';' after top level declarator
void Init(Handle<Object> exports, Handle<Object> module) {
                                                        ^
                                                        ;
8 errors generated.
make: *** [Release/obj.target/tree_sitter_tsx_binding/tsx/src/binding.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/nicholas/Development/blueprint/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/Cellar/node/12.12.0/bin/node" "/Users/nicholas/Development/blueprint/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/nicholas/Development/blueprint/node_modules/tree-sitter-typescript

@nicholas-l
Copy link
Author

I'll open an issue on tree-sitter-typescript

@adidahiya
Copy link
Contributor

it looks like Node 12 is now LTS, so our CI builds are also failing

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

Successfully merging a pull request may close this issue.

2 participants