WuTheFWasThat / vimflowy

An open source productivity tool drawing inspiration from workflowy and vim
https://www.wuthejeff.com/vimflowy
MIT License
1.6k stars 111 forks source link

SQLITE_CANTOPEN: unable to open database file #289

Closed ghost closed 6 years ago

ghost commented 6 years ago

So, I tried to get Vimflowy running with SQLite local database. After I did everything as outlined here:

https://github.com/WuTheFWasThat/vimflowy/blob/master/docs/storage/SQLite.md

I am getting the following error in the terminal whenever I try to load VimFlowy

Using sqlite database: true/vimflowy.sqlite (node:11709) UnhandledPromiseRejectionWarning: Error: SQLITE_CANTOPEN: unable to open database file (node:11709) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:11709) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I guesss it's not creating an SQLite db? I'm not really sure how to fix it.

WuTheFWasThat commented 6 years ago

it looks like you're passing "true" as the dbfolder. you need to pass a valid folder

in case I'm wrong, first try without a database file: npm run startprod -- --db sqlite

if that works, then try making some new empty directory and then doing npm run startprod -- --db sqlite --dbfolder $that_directory

ghost commented 6 years ago

Ok, so when I try to run without a databse it runs successfuly

Starting production server Listening on http://127.0.0.1:3000 New socket connection! Using in-memory sqlite database

but then when I add the dbfolder flag and point it at a new empty directory I get the same error outlined in the original post.

WuTheFWasThat commented 6 years ago

are you giving an absolute path? could you please tell me the exact command you're running? also make sure you have permissions to that folder

ghost commented 6 years ago

LOL, oh man I feel silly....I had setup the command in an alias in .bashrc so I could just type "vimflowy" to get it running.

npm run startprod -- --db sqlite --dbfolder $~/vimflowyDB

as you can see the '$~/vimflowyDB' is nonsense, so I simply removed the $ and now it works!

Thanks for the help, and for making Vimflowy! Combining my favorite editing system with my favorite note-taking system = PURE GENIUS!