Tutorial: How to fix Cannot find module 'mysql2'


The famous dreaded error for NodeJS Wapplers, Cannot find module 'mysql2'

How to solve this:
You need to run npm install in the terminal, in the folder of your project. Are you using shared hosting? You'll most likely find a button to "NPM Install".

I just had this error, and as I was writing this topic asking for help from the shared-hosting battle-tester @Hyperbytes, I remembered about this npm install, possibly I gave that advice somewhere... :man_shrugging:

Here's a video tutorial, probably it's the same issue:

1 Like