Node_sqlite3.node: cannot open shared object file

Describe the problem/error/question

I’m hosting n8n version 1.89.2 on an AWS EC2 instance via Elastic Beanstalk (EBS), using PostgreSQL as the database.
Even though I am not using SQLite as my database, when activating a workflow with the @n8n/n8n-nodes-langchain.chatTrigger node, n8n tries to load the sqlite3 module.

At runtime, I get an error saying that node_sqlite3.node cannot be opened, even though the file exists.

I’ve tried several solutions, but the error persists.


What is the error message (if any)?

/var/app/current/node_modules/sqlite3/build/Release/node_sqlite3.node: cannot open shared object file: No such file or directory

Please share your workflow

Share the output returned by the last node

No output — the workflow crashes immediately when trying to start because sqlite3 fails to load.


Information on your n8n setup

  • n8n version: 1.89.2
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): AWS EC2 via Elastic Beanstalk (EBS)
  • Operating system: Node.js 20 running on 64bit Amazon Linux 2023

What I tried already (but didn’t work)

  • Verified that the file /var/app/current/node_modules/sqlite3/build/Release/node_sqlite3.node exists and has correct permissions.
  • Rebuilt sqlite3 from source on the EC2 instance with:
    • npm rebuild sqlite3 --build-from-source
    • Also tried uninstalling and reinstalling it.
  • Installed all system libraries:
    • sudo yum groupinstall -y "Development Tools"
    • sudo yum install -y gcc-c++ make python3 sqlite sqlite-devel
  • Checked ldd node_sqlite3.node → sometimes reports “not a dynamic executable.”
  • Confirmed Node.js version is 20.x, matching n8n requirements.
  • Reinstalled dependencies cleanly:
    • Deleted node_modules, package-lock.json
    • Cleared npm cache with npm cache clean --force
    • Fresh npm install
  • Confirmed sqlite3 is necessary because of the @n8n/n8n-nodes-langchain nodes being used.
  • Attempted using --omit=optional, but sqlite3 is a direct dependency, so it still installs.
  • Tried to manually rebuild inside the EC2 environment — no success.

Additional Notes

It seems that the @n8n/n8n-nodes-langchain package requires sqlite3, even if PostgreSQL is configured.
This forces n8n to try loading sqlite3 at runtime even when not using it directly, leading to this crash.


:arrow_right: Question:

  • Is there a way to make @n8n/n8n-nodes-langchain not require sqlite3 at runtime?
  • Can the team provide a prebuilt sqlite3 binary compatible with Amazon Linux 2023 + Node 20?
  • Or is there a recommended workaround for hosted setups without SQLite?