Idk whats up with my bot


#1

So i was editing my discord bot without any problem

then i kept getting "Error: couldnt find module Express"
i removed node_modules then did a refresh so it can install
it kept saying that error

i did pnpm i and it asked me to use –force
so i did pnpm i --force

everything cameback working, BUT.
the console log is now logging everytime a change happens to the sqlite3 database
{ ID: ‘userxp_875477655198466049’, json: ‘564713.0’ } …etc
and im recieving deprecation warnings like
(node:6687) DeprecationWarning: Collection#find: pass a function instead

i had NONE of these problems before the first error… and now im scared its not even logging in the sqlite3 db but just basic json
my bot’s code has nothing to console.log database changes


#2

Idk why, I had a backup downloaded, so i went into the files

apparently, shrinkwrap.yaml was affected?
because i remember when i did pnpm i, it said that i will need –force to change the shrinkwrap and i did.
i used the shrinkwrap from the old backup and removed node_modules, did a refresh
now its working
no database loggings, no deprecation warnings… and the bot is working fine…


#3

Hey @fnnn from what you’ve written here it looks to me like you forced a pnpm update of all of your packages and that one (or more) of the updated packages had changes which were incompatible with the way your code is written - some functions you were relying on had been deprecated by newer version of some packages for instance.

When you restored your pre-pnpm i --force shrinkwrap.yaml file (this file tracks what versions of what packages are currently installed) your project reverted to versions of the packages that worked with your existing code as expected.

Glad you got it working again, and let us know if you run into further issues!


#4

yeah thats what i thought too, because i noticed different versions while comparing the two shrinkwrap files. thanks for your explanation <3 luch love


#5

It sadly happened again

/rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/bindings/1.3.0/node_modules/bindings/bindings.js:88
throw e
^
Error: The module '/rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (module.js:682:18)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at bindings (/rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/bindings/1.3.0/node_modules/bindings/bindings.js:81:44)
at Object.&lt;anonymous&gt; (/rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/lib/database.js:4:40)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)

did a pnpm rebuild and now i have

  throw err

  ^


Error: Could not locate the bindings file. Tried:

 → /rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/build/better_sqlite3.node

 → /rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/build/Debug/better_sqlite3.node

 → /rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/build/Release/better_sqlite3.node

 → /rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/out/Debug/better_sqlite3.node

 → /rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/Debug/better_sqlite3.node

 → /rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/out/Release/better_sqlite3.node

 → /rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/Release/better_sqlite3.node

 → /rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/build/default/better_sqlite3.node

 → /rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/compiled/8.14.0/linux/x64/better_sqlite3.node

    at bindings (/rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/bindings/1.3.0/node_modules/bindings/bindings.js:93:9)

    at Object.<anonymous> (/rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/lib/database.js:4:40)

    at Module._compile (module.js:653:30)

    at Object.Module._extensions..js (module.js:664:10)

    at Module.load (module.js:566:32)

    at tryModuleLoad (module.js:506:12)

    at Function.Module._load (module.js:498:3)

    at Module.require (module.js:597:17)

    at require (internal/module.js:11:18)

    at Object.<anonymous> (/rbd/pnpm-volume/4d42fe1d-26cb-43dc-934f-47f7c781e273/node_modules/.registry.npmjs.org/better-sqlite3/4.1.1/node_modules/better-sqlite3/index.js:2:18)

how do i stop getting this everytime i make a change? :sob:


#6

If you take a look around the forums you’ll see this is a not-uncommon problem that others have encountered. Running enable-pnpm in your project’s console forces a complete reinstall and is typically enough to fix the bindings longer-term, so you might try that.