Failed to thiea rebuild:electron

class Object;
^
/Users/didi/.electron-gyp/9.3.5/include/node/v8.h:483:27: error: incomplete type ‘v8::ArrayBuffer’ named in nested name specifier
using Allocator = v8::ArrayBuffer::Allocator;
^~~~~~~~~
/Users/didi/.electron-gyp/9.3.5/include/node/v8.h:41:7: note: forward declaration of ‘v8::ArrayBuffer’
class ArrayBuffer;
^
/Users/didi/.electron-gyp/9.3.5/include/node/v8.h:497:5: error: use of undeclared identifier ‘Allocator’
Allocator::AllocationMode AllocationMode() const {
^
/Users/didi/.electron-gyp/9.3.5/include/node/v8.h:509:14: error: use of undeclared identifier ‘Allocator’
Allocator::AllocationMode allocation_mode, DeleterCallback deleter,
^
/Users/didi/.electron-gyp/9.3.5/include/node/v8.h:516:5: error: use of undeclared identifier ‘Allocator’
Allocator::AllocationMode allocation_mode_;
^
/Users/didi/.electron-gyp/9.3.5/include/node/v8.h:547:7: error: unknown type name ‘ArrayBufferCreationMode’
ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
165808 warnings and 20 errors generated.
make: *** [Release/obj.target/drivelist/src/drivelist.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/didi/didi/dide/node_modules/electron-rebuild/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command “/usr/local/bin/node” “/Users/didi/didi/dide/node_modules/electron-rebuild/node_modules/.bin/node-gyp” “rebuild” “–target=9.3.5” “–arch=x64” “–dist-url=https://www.electronjs.org/headers” “–build-from-source”
gyp ERR! cwd /Users/didi/didi/dide/node_modules/drivelist
gyp ERR! node -v v12.19.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok

Failed with exit code: 1
at SafeSubscriber._error (/Users/didi/didi/dide/node_modules/spawn-rx/lib/src/index.js:267:84)
at SafeSubscriber.__tryOrUnsub (/Users/didi/didi/dide/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:205:16)
at SafeSubscriber.error (/Users/didi/didi/dide/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:156:26)
at Subscriber._error (/Users/didi/didi/dide/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:92:26)
at Subscriber.error (/Users/didi/didi/dide/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:72:18)
at MapSubscriber.Subscriber._error (/Users/didi/didi/dide/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:92:26)
at MapSubscriber.Subscriber.error (/Users/didi/didi/dide/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:72:18)
at SafeSubscriber._next (/Users/didi/didi/dide/node_modules/spawn-rx/lib/src/index.js:242:65)
at SafeSubscriber.__tryOrUnsub (/Users/didi/didi/dide/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:205:16)
at SafeSubscriber.next (/Users/didi/didi/dide/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:143:22)
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! @theia/example-electron@1.8.0 build: theia rebuild:electron
npm ERR! Exit status 255

@JohnsenZhou thank you for reporting the error, can you perhaps include some additional detail such as:

  • steps to reproduce
  • the application you are attempting to build (ex: is it the upstream theia sources?)

Thanks for your reply!
My system is macos Catalina, node-gyp will have some problems on this system.
I fix the node-gyp issue first and reinstall node_modules again, then it’s succeed.

2 Likes