I just tried to build the Joplin Electron Client for the first time on a Arch Linux machine, following the instructions in BUILD.md
.
On the npm i
part, I get the following node-gyp related error:
In file included from ../src/database.cc:3:
../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_AfterLoadExtension(uv_work_t*)’:
../src/macros.h:91:13: error: no matching function for call to ‘v8::String::Concat(v8::Local<v8::String>, v8::Local<v8::String>)’
91 | ), \
| ^
...
make: *** [node_sqlite3.target.mk:125: Release/obj.target/node_sqlite3/src/database.o] Error 1
make: Leaving directory '/home/geo/code/joplin/ElectronClient/app/node_modules/sqlite3/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:196:23)
gyp ERR! stack at ChildProcess.emit (events.js:219:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
gyp ERR! System Linux 5.3.11-arch1-1
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/geo/code/joplin/ElectronClient/app/node_modules/sqlite3/lib/binding/node-v79-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/geo/code/joplin/ElectronClient/app/node_modules/sqlite3/lib/binding/node-v79-linux-x64" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v79"
gyp ERR! cwd /home/geo/code/joplin/ElectronClient/app/node_modules/sqlite3
gyp ERR! node -v v13.3.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/geo/code/joplin/ElectronClient/app/node_modules/sqlite3/lib/binding/node-v79-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/geo/code/joplin/ElectronClient/app/node_modules/sqlite3/lib/binding/node-v79-linux-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/geo/code/joplin/ElectronClient/app/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:219:5)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1027:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:5)
node-pre-gyp ERR! System Linux 5.3.11-arch1-1
node-pre-gyp ERR! command "/usr/bin/node" "/home/geo/code/joplin/ElectronClient/app/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/geo/code/joplin/ElectronClient/app/node_modules/sqlite3
node-pre-gyp ERR! node -v v13.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/geo/code/joplin/ElectronClient/app/node_modules/sqlite3/lib/binding/node-v79-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/geo/code/joplin/ElectronClient/app/node_modules/sqlite3/lib/binding/node-v79-linux-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
I saw the BUILD.md
has a section on node-gyp related errors, so I tried that, but the error is the same.
I found this to be very weird because I installed joplin via the AUR
before and there it compiles just fine. So I checked out the PKGBUILD of Joplin on AUR and indeed there seems to be a workaround in place for the above issue:
...
# Electron App
cd "${srcdir}/${pkgname}-${pkgver}/ElectronClient/app"
# NOTE: Manually forcing sqlite 4.0.7 for node v12, remove later on
npm install sqlite3@4.0.7
npm install
If I do the above, that is, manually setting sqlite to 4.0.7
. (The package.json
specifies ^4.0.6
). Things compile fine.
Did someone see this before? I have the feeling this is related to the node
/ node-gyp
versions, could someone whose build works just fine share their output of node -v
and node-gyp -v
? Thanks!