reproduced on macOS
(but like effects all systems)
Terminal / CLI (from npm)
During the upgrade of the node homebrew formula to the newly released version 10 in https://github.com/Homebrew/homebrew-core/pull/27036, we've noticed that the joplin cli is unable to be build against this node version. When trying to build with node 10 you will get the following build error, because the sqlite3 version currently used in joplin in pinning nan to an to old version.
:In file included from 10../src/database.h:
:In file included from 10../node_modules/nan/nan.h:
:In file included from 192:
../node_modules/nan/nan.h:../node_modules/nan/nan_maybe_43_inl.h:112192::
15:../node_modules/nan/nan_maybe_43_inl.h: error: 112:no member named 'ForceSet' in 'v8::Object'15
: error: no member named 'ForceSet' in 'v8::Object'
return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs); return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
~~~ ^
~~~ ^
In file included from ../src/node_sqlite3.cc:8:
In file included from ../src/database.h:10:
In file included from ../node_modules/nan/nan.h:192:
../node_modules/nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet' in 'v8::Object'
return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
~~~ ^
1 error generated.
make: *** [Release/obj.target/node_sqlite3/src/statement.o] Error 1
make: *** Waiting for unfinished jobs....
1 error generated.
make: *** [Release/obj.target/node_sqlite3/src/database.o] Error 1
1 error generated.
make: *** [Release/obj.target/node_sqlite3/src/node_sqlite3.o] Error 1
A potential fix would be to upgrade sqlite3 to version 4.0.0. Although this is a semver major upgrade, there are no code changes between the currently used version 3.1.13 and 4.0.0. The only noticeable changes are 2 dependency upgrades: The required nan upgrade and a node-pre-gyp upgrade (which results in dropping support for node 0.10 and 0.12 making this release semver major).
In the parent post you mention making Joplin depend on node@8. Could we do this instead?
Not sure if something needs to be done about this?
I think I'm facing the same issue here. My NodeJS knowledge is non-existent, but maybe you can do something with the output:
make: *** [node_sqlite3.target.mk:115: Release/obj.target/node_sqlite3/src/database.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Linux 4.16.5-1-ARCH
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "build" "--f
allback-to-build" "--module=/home/tcassaert/.joplin-bin/lib/node_modules/joplin/node_modules/s
qlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--modu$
e_path=/home/tcassaert/.joplin-bin/lib/node_modules/joplin/node_modules/sqlite3/lib/binding/no
de-v64-linux-x64"
gyp ERR! cwd /home/tcassaert/.joplin-bin/lib/node_modules/joplin/node_modules/sqlite3
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
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/node-gyp
/bin/node-gyp.js build --fallback-to-build --module=/home/tcassaert/.joplin-bin/lib/node_modul
es/joplin/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node --module_name=
node_sqlite3 --module_path=/home/tcassaert/.joplin-bin/lib/node_modules/joplin/node_modules/sq
lite3/lib/binding/node-v64-linux-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/tcassaert/.joplin-bin/lib/node_
modules/joplin/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:947:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:
236:5)
node-pre-gyp ERR! System Linux 4.16.5-1-ARCH
node-pre-gyp ERR! command "/usr/bin/node" "/home/tcassaert/.joplin-bin/lib/node_modules/joplin/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/tcassaert/.joplin-bin/lib/node_modules/joplin/node_modules/sqlite3
node-pre-gyp ERR! node -v v10.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/tcassaert/.npm/_logs/2018-05-03T08_08_26_714Z-debug.log
If you need anything else, I'm happy to provide it.
+1
Not sure if something needs to be done about this?
@laurent22 You should read this as a feature request for node 10 support / upgrading the sqlite3 dependency to version 4.0.0, which should be a simple version bump without any code changes required.
In the parent post you mention making Joplin depend on node@8. Could we do this instead?
Unfortunately homebrew tries to avoid depending on versioned formulae and prefers using the latest version instead whenever possible. Currently I see no other issue with running joplin with node 10 (except the required sqlite3 version bump), which would justify the usage of a versioned formula like node@8 as a dependency of the joplin formula. If you think otherwise you could open a PR yourself for requesting this change of cause.
@tcassaert: It's the same issue. Joplin or more precisely one of it's dependencies (in the version currently used in joplin) does not support node 10 yet. You have to either run it with node 8 LTS (or use some tricks to manually upgrade the sqlite3 dependency to version 4.0.0) for now.
I believe I am also running into this problem. Using Arch Linux, my error output is as follows:
[username@hostname] ~ $ joplin
module.js:549
throw err;
^
Error: Cannot find module '/home/username/.joplin-bin/lib/node_modules/joplin/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/jhw/.joplin-bin/lib/node_modules/joplin/node_modules/sqlite3/lib/sqlite3.js:4:15)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
I have installed nvm and set my terminal session forced to use node 8.11.1, but this did not resolve the issue. I am not clear on how I can get this working again, outside of waiting for a fix to be pushed.
@createchange This is unreleated. You have to rebuild native addons when switching between node major versions because of the change in ABI (reflected by a different NODE_MODULE_VERSION). You have to either run npm rebuild on joplin or just reinstall it with node 8.
@chrmoritz Thank you for your help, I was able to resolve my issue. I apologize for not creating my own ticket. Take care everyone!
I've just temporarly downgraded my node version to 9.10 on Arch and it works without an issue.
Thanks for clarifying @chrmoritz, I will upgrade SQLite to make it compatible with node 10.
Same problem here, I think.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Is there any work around for this?
Currently it locks me out of Joplin on Archlinux.
I have also Atom installed which insists on npm >= 10 and so downgrading does not really work.
Any suggestions?
@MarcusE1W Manually patching joplin to use sqlite3 v4.0.0 instead of v3.1.x as we do in homebrew should work as a workaround.
Fixed in 3fc54d7ffdb42efdd3a825a16dca6fc37e31c555
Most helpful comment
Thanks for clarifying @chrmoritz, I will upgrade SQLite to make it compatible with node 10.