SQLite package has not been found installed after a npm update -g n8n

Hello community,
After a npm update -g n8n on my Windows 11, no way to restart my n8n. It fails with this error :

Initializing n8n process
Initial database connection attempt 1 failed: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save. Retrying in 1000ms
Initial database connection attempt 2 failed: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save. Retrying in 2000ms
Initial database connection attempt 3 failed: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save. Retrying in 4000ms
Initial database connection attempt 4 failed: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save. Retrying in 8000ms
Initial database connection attempt 5 failed: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save. Retrying in 16000ms
There was an error initializing DB
Error: There was an error initializing DB
at Start.exitWithCrash (C:\Users\steph\AppData\Roaming\npm\node_modules\n8n\src\commands\base-command.ts:253:28)
at C:\Users\steph\AppData\Roaming\npm\node_modules\n8n\src\commands\base-command.ts:152:17
at Start.init (C:\Users\steph\AppData\Roaming\npm\node_modules\n8n\src\commands\base-command.ts:148:3)
at Start.init (C:\Users\steph\AppData\Roaming\npm\node_modules\n8n\src\commands\start.ts:212:3)
at CommandRegistry.execute (C:\Users\steph\AppData\Roaming\npm\node_modules\n8n\src\command-registry.ts:96:4)
at C:\Users\steph\AppData\Roaming\npm\node_modules\n8n\bin\n8n:63:2

This has worked perfectly the last 2 years, … Any known issue with the latest package ?

Obviously, my npm environment has changed, … (I also develop n8n node on the same machine, I don’t know the side effect on that)

I got my n8n back with this update

npm install -g n8n --allow-scripts=@parcel/watcher,isolated-vm,sqlite3,agent-browser,oracledb,protobufjs,msgpackr-extract,ssh2,@sentry/node-native-stacktrace,@sentry/node-cpu-profiler,cpu-features,@scarf/scarf

hi @hsteph
The key difference is the --allow-scripts flag. Packages like sqlite3 need to run install scripts to download or build their native binaries. By reinstalling with that flag, npm executed those scripts, sqlite3 was installed properly, and n8n could initialize the database successfully.

1 Like