I’m having this error in my discord bot project :
ken-bot-beta
Here’s the logs :
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module '../build/better_sqlite3.node'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/rbd/pnpm-volume/2a92fb35-8c15-4512-b4c5-a54cbb900300/node_modules/.registry.npmjs.org/better-sqlite3/5.4.0/node_modules/better-sqlite3/lib/database.js:5:21)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
I fixed canvas by myself but it is now looking for better_sqlite3.node.
When I add better_sqlite3.node to my package.json
it makes the canvas.node error appear again. I don’t know what to do, I tried doing everything that already existed but it is not sufficient.
My package.json
:
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module '../build/better_sqlite3.node'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/rbd/pnpm-volume/2a92fb35-8c15-4512-b4c5-a54cbb900300/node_modules/.registry.npmjs.org/better-sqlite3/5.4.0/node_modules/better-sqlite3/lib/database.js:5:21)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
Project is here : https://glitch.com/edit/#!/ken-bot-beta?path=package.json:0:0