I'm getting an almost identical issue when trying to use the cli in any way, except joplin seems to be looking for the 'node-v88-linux-x64' directory, when that path holds node-v83-linux-x64 for me.
I'm on arch linux, and node recently updated: upgraded nodejs (14.14.0-1 -> 15.0.1-1)
My output if it's any help:
node:internal/modules/cjs/loader:903
throw err;
^
Error: Cannot find module '/usr/share/joplin-cli/node_modules/sqlite3/lib/binding/node-v88-linux-x64/node_sqlite3.node'
Require stack:
- /usr/share/joplin-cli/node_modules/sqlite3/lib/sqlite3.js
- /usr/share/joplin-cli/lib/database-driver-node.js
- /usr/share/joplin-cli/lib/BaseApplication.js
- /usr/share/joplin-cli/app.js
- /usr/share/joplin-cli/main.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:900:15)
at Function.Module._load (node:internal/modules/cjs/loader:745:27)
at Module.require (node:internal/modules/cjs/loader:972:19)
at require (node:internal/modules/cjs/helpers:88:18)
at Object.<anonymous> (/usr/share/joplin-cli/node_modules/sqlite3/lib/sqlite3.js:4:15)
at Module._compile (node:internal/modules/cjs/loader:1083:30)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
at Module.load (node:internal/modules/cjs/loader:948:32)
at Function.Module._load (node:internal/modules/cjs/loader:789:14)
at Module.require (node:internal/modules/cjs/loader:972:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/share/joplin-cli/node_modules/sqlite3/lib/sqlite3.js',
'/usr/share/joplin-cli/lib/database-driver-node.js',
'/usr/share/joplin-cli/lib/BaseApplication.js',
'/usr/share/joplin-cli/app.js',
'/usr/share/joplin-cli/main.js'
]
}
Thanks for sharing, @mascot. It does look like the same issue. I don't know if it's Joplin or nodejs? Up to now it's been solid through all updates.
I use the terminal version for automated backups of the notes, and don't usually view or edit notes with it. I'll just stay with the previous version of nodejs for now, and whenever either Joplin or `nodejs' update try again.
The sqlite nodejs package has been a pain in our asses since the beginning. During install it builds a binding lib that apparently only works with the nodejs version it was compiled for.
Maybe you should open an issue with sqlite and ask them to be more flexible.
Thanks for the input, @tessus. I dimly remember a similar issue I had a long time back, and that was down to how I had the nodejs environment set up also.
In case it's useful to anyone else, here follows how I set it up. Maybe not the correct way, but it worked for me. Disclaimer: I have no knowledge of nodejs
This for linux, but similar steps for MAC or Windows
(This puts joplin under the ~/npm-global/ tree, rather than ~/.joplin-bin, but as the database is stored with config files in a different location, it makes no difference)
Assuming nodejs is installed:
npm install -g npm (with admin privileges)
mkdir ~/.npm-global
Append $HOME/.npm-global/bin to your PATH statement (.bashrc, in linux and then source .bashrc)
Set npm config prefix:npm config set prefix $HOME/.npm-global, this will create ~/.npmrc if it doesn't already exist)
Check npm config prefix:npm config get prefix to confirm
npm install -g joplin
If it doesn't succeed, check for missing libraries in the error output, install them and try again
I'll continue with npm install -g joplin for updates and see if it stands the test of time.