There was an error initializing DB: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save

After installing the latest version of n8n and running the n8n start the command, I am getting this error

C:>n8n start
There was an error initializing DB: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save

Stopping n8n…

Machine Specification:

OS: Windows Server 2016
npm: 7.3.0
Node.js v15.5.0.
Visual Studio 2019

Can Someone help me solve this?

P.S. I am using the npm approach as I only have few cron based workflows.

I am very sorry. Sadly do not run windows for many years, so have no experience here. Maybe another community member can help you to figure out what is going on.

If not, it is probably best to simply uninstall n8n and then reinstall it. The data is saved separately in your home-folder in the folder .n8n. So your workflows and credentials will not be lost and n8n will find them again automatically.

This should work on Windows:

npm install -g windows-build-tools
git clone https://github.com/n8n-io/n8n
cd n8n
lerna bootstrap --hoist
npm run build
npm run start

Hi Ivov,

I tried your approach but was getting some error when I run npm run build cmd. So, I chose to completely remove and reinstall n8n.

Thanks for the quick response!

Hi Jan,

As always thanks for the quick response! You advice of reinstalling n8n help. I was scare that i will loose all work flow. But, after you mentioned that uninstallation process wont remove workflow, I was confidently able to resolve this issue.

Thanks Again !

You are welcome. Really glad to hear that it helped.

Wish you a great weekend & Have fun!

I am facing the same problem.

Initializing n8n process
There was an error initializing DB: "SQLite package has not been found installed. Try to install it: npm install sqlite3 --save"

Stopping n8n...

any other ways to solve this problem besides the steps mentioned above?

i am using n8n 0.199.0, and sqlite3 5.1.2…

Hi @chrischma, welcome to the community!

I am sorry to hear you’re having trouble. Going forward, it’d be great if you could open a new topic for such questions. When posting a new question, the forum will show you a template asking for a bunch of details that help us understand your setup.

My first guess from looking at the error message would be that you’re perhaps running n8n on bare metal and might be using an old version of Node.js as I seem to remember trouble with the sqlite package on older versions. So, in a first step it’d be great if you could try to upgrade to the current LTS version of Node.js (Node.js 16) and give this another go.

If launching n8n still fails, could you open a new thread with all the relevant information? Thank you so much!

Thank you for your reply! i am already using Node.js 16…

Okay, so it’d be great if you could open a new thread with all relevant information on your environment and the exact steps to reproduce the problem. Thank you so much!