Pg library error when deploying app with elastic beanstalk

I am using elastic beanstalk and rds in Amazon web services to set up my web application, and I keep getting an error with the pg library. The app deploys fine when I submit the code without the pg library but otherwise, I get this error:

Cannot find module '/var/app/current/node_modules/pg-protocol/dist/index.js'. Please verify that the package.json has a valid "main" entry

I have searched for this problem on the internet but can't found anything useful. I would appreciate it a lot if someone could help me, I am from Peru and these technologies are not common here.

Thanks a lot

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum