electron / rebuild

Package to rebuild native Node.js modules against the currently installed Electron version
MIT License
1.03k stars 175 forks source link

it is not rebuilding for electron from the package root #1101

Open sibelius opened 1 year ago

sibelius commented 1 year ago

When I call, it does not rebuild my native package

yarn electron-rebuild

However, when I rebuild like this

cd node_modules/@woovi/node-printer
../../.bin/electron-rebuild
sibelius commented 1 year ago

it looks like it does not work for @woovi named scope packages

DEBUG=* yarn electron-rebuild --force -m node_modules/@woovi/node-printer

works

spamshaker commented 10 months ago

it doesn't work with @electron/rebuild. I have similar issue with sqlite3 package I am using pnpm and when I add electron-rebuild package (legacy)

pnpm electron-rebuild --force -m node_modules/sqlite3 then I can see: and all is fine ⠇ Building module: sqlite3, Completed: 0 CC(target) Release/obj.target/nothing/../../../node-addon-api@4.3.0/node_modules/node-addon-api/nothing.o LIBTOOL-STATIC Release/nothing.a ⠏ Building module: sqlite3, Completed: 0warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols) ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3410100/sqlite3.c ⠋ Building module: sqlite3, Completed: 0 TOUCH Release/obj.target/deps/action_before_build.stamp CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3410100/sqlite3.o ⠴ Building module: sqlite3, Completed: 0 LIBTOOL-STATIC Release/sqlite3.a ⠦ Building module: sqlite3, Completed: 0 CXX(target) Release/obj.target/node_sqlite3/src/backup.o

but when i install @electron/rebuild then I can see which is obviously fail cause nothing has been rebuilt

pnpm electron-rebuild --force -m node_modules/sqlite3 ✔ Rebuild Complete

I ran it also with DEBUG=* so that I can see

electron-rebuild failed to read module arch: ENOENT: no such file or directory, stat '/p/.pnpm/sqlite3@5.1.6/node_modules/sqlite3/lib/binding/napi-v3-darwin-unknown-arm64/node_sqlite3.node' +1ms read-binary-file-arch file command output /p/node_modules/.pnpm/sqlite3@5.1.6/node_modules/sqlite3/lib/binding/napi-v6-darwin-unknown-arm64/node_sqlite3.node: Mach-O 64-bit bundle arm64 +0ms read-binary-file-arch result: Mach-O 64-bit bundle arm64 +0ms read-binary-file-arch archMatch: arm64 +0ms electron-rebuild module arch: arm64 +4ms