This error occurs because the folders related to installed dependencies are not properly configured. In the case of SQLite3, PNPM does not automatically execute the build scripts after installation, as it ignores them by default. As a result, the required build
folder is not created, leading to the following error message:
"Could not locate the bindings file"
To manually trigger the execution of SQLite3's build scripts, run the following command:
pnpm approve-builds
When installing packages with PNPM, you may notice that some build scripts are ignored, as shown in the log below:
Packages: +184
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 185, reused 0, downloaded 184, added 184, done
dependencies:
+ axios 1.7.9
+ sqlite3 5.1.7
devDependencies:
+ @types/node 22.13.1
+ ts-node-dev 2.0.0
+ typescript 5.7.3
Ignored build scripts: sqlite3. Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.
Done in 3.8s
PNPM explicitly states that the SQLite3 build script was ignored and suggests running "pnpm approve-builds" to manually approve the execution of these scripts.
If you encounter the "Could not locate the bindings file" error, simply run pnpm approve-builds
to fix the issue and ensure SQLite3 functions correctly.
If you have any questions, feel free to ask! ❤️