NPM Package won't install

The package (better-sqlite3) looks like it’s installed in the package.json file, but when I try to require it I get the following error:

Error: Cannot find module 'better-sqlite3'

Have you tried doing an npm install in the console? Perhaps it is listed in package.json but did not get installed for some reason.

1 Like

Hey @CedricGrothues, welcome to the Glitch forum!

I’d suggest running enable-pnpm in the console, which triggers a fresh pnpm install and may fix installation problems that might be causing the issue you’re seeing… If possible allowing Glitch to manage your packages is preferable to installing packages manually so that Glitch is able to keep everything inline. For example if you npm install something while the rest of your project is using pnpm Node may have a hard time finding packages in different storage locations.

Hope this helps!

1 Like