Discord.js bot error


#1

i want to start my bot but i got this error

Error: Could not locate the bindings file. Tried:
→ /rbd/pnpm-volume/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/better_sqlite3.node
→ /rbd/pnpm-volume/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
→ /rbd/pnpm-volume/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/Release/better_sqlite3.node
→ /rbd/pnpm-volume/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
→ /rbd/pnpm-volume/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/Debug/better_sqlite3.node
→ /rbd/pnpm-volume/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/out/Release/better_sqlite3.node
→ /rbd/pnpm-volume/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/Release/better_sqlite3.node
→ /rbd/pnpm-volume/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/default/better_sqlite3.node
→ /rbd/pnpm-volume/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/compiled/8.15.0/linux/x64/better_sqlite3.node
at bindings (/rbd/pnpm-volume/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/bindings/1.3.0/node_modules/bindings/bindings.js:93:9)
at Object.<anonymous> (/rbd/pnpm-volume/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/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/c6467a4f-d7c4-45cb-84cf-caa2a7667b61/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/index.js:2:18)

MOD EDIT: formatting


#2

Hi @ikmarokko2, welcome to the Glitch Forums!

We see this problem occasionally with the better-sqlite3 package. You can try running enable-pnpm in your project’s console. If that doesn’t resolve it you could also try running rm shrinkwrap.yaml and then running enable-pnpm.

Let us know how that goes!


#3

i did enable-pnpm but its not working


Sqlite Discord Bot Error Corrupt?
#4

He gave two suggestions @ikmarokko2. Try the second one. " If that doesn’t resolve it you could also try running rm shrinkwrap.yaml and then running enable-pnpm ."


#5

That was my fault, I think - i merged an older post from a different topic so it looks like it came later, but it was actually from before I posted my 2nd suggestion.


#6

nope, now its saying parse error: Unfinished JSON term at EOF at line 36, column 18


#7

That seems like a problem in your package.json file, although it could be another file - without seeing the whole list of errors it’s hard to tell.

If you provide your project name someone can take a look and see if we can give some specific help.


#8

I can send the code via discord. If you want


#9

I’d prefer to keep it here so all the Glitch staff can review it if needed and other community members can learn from whatever we discover. If your project is private you can share the project name here and no one who’s not on the project or a Glitch staff member will be able to see the code. If you’re uncomfortable with that you can email it to support@glitch.com or message staff in a private message.


#10

Try these following steps:

$ npm i node-gyp --save-dev
$ cd node_modules/better-sqlite3
$ node-gyp-rebuild

EDIT: Try npm i node-gyp -g if it doesn’t work.

If the problem persists,
Execute following commands;

$ rm -f node_modules
$ npm install

#11

@anon43389526 suggestions might help, although I’ll give these caveats:

  • you’re probably better off using pnpm and not npm in Glitch, so you don’t give up project space to node_modules
  • -g won’t work in Glitch

We’re still happy to take a closer look and offer project-specific suggestions if you’re still stuck


#12

nope its not working