I've installed node via nvm, and I installed nvm via homebrew.
Here are my versions:
I also have another version of node (v9.11.1) installed via homebrew, but my nvm default is the above v8.11.1 and my PATH lists nvm first, as seen here:
/Users/kg/.nvm/versions/node/v8.11.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Here's what I'm seeing when I run joplin:
$ joplin
module.js:549
throw err;
^
Error: Cannot find module '/usr/local/Cellar/joplin/1.0.106/libexec/lib/node_modules/joplin/node_modules/sqlite3/lib/binding/node-v57-darwin-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> (/usr/local/Cellar/joplin/1.0.106/libexec/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 noticed that it's looking for:
/usr/local/Cellar/joplin/1.0.106/libexec/lib/node_modules/joplin/node_modules/sqlite3/lib/binding/node-v57-darwin-x64/node_sqlite3.node
but I have:
/usr/local/Cellar/joplin/1.0.106/libexec/lib/node_modules/joplin/node_modules/sqlite3/lib/binding/node-v59-darwin-x64/node_sqlite3.node
It also looks like v8.11.1 version is 57, but v9.11.1 is 59. (detailed here) I'm not really sure why or how it's trying to use system node over nvm node. I've actually removed the 9.11.1 binary, but I'm still getting the exact above error.
I've tried uninstalling both node and joplin, reinstalling both, and running, but got the same result.
I've seen the other 4+ issues that report something similar but haven't seen anything that's helped.
I don't have file permissions issues, didn't install anything with sudo, etc.
I really want to use joplin, but not sure how to progress from here.
The app must be started with the same version of node that installed it, and it will use the system node. So probably you need to switch to the right version of node before starting the app.
Or uninstall/reinstall if you want to use a different version of node. The key is that during installation some modules (eg sqlite) are going to be compiled to binary code, and these modules will only be compatible with the version of node at the installation time.
I get the need to use the same version that was used to install the app, but I didn't realize joplin was going to end up using system node, even when the nvm version is in my path, before the system node binary.
I'll try this later today when I have some free time. Thanks for the prompt response 馃憤
I was running into the same problem and it's like @laurent22 already pointed out.
If you're using nvm the quick fix is to just switch to your system node.
$ nvm current
v8.9.4
$ nvm use system
Now using system version of node: v9.11.1 (npm v5.6.0)
$ nvm current
system
$ joplin
So that worked. Just making sure to use system node before I install joplin. Thanks @blindgaenger and @laurent22
I set this up as a shell alias so I didn't have to switch node versions every time I use joplin:
alias joplin='/usr/local/bin/node /usr/local/bin/joplin'
Most helpful comment
I set this up as a shell alias so I didn't have to switch node versions every time I use joplin: