skip to Main Content

I’m new to NGINX. I am trying to run my Node server with sudo pm2 start server.js but I keep on getting MODULE_NOT_FOUND requireStack error. Everything’s fine when I run it to a local machine but when I run on nginx, this keeps happening. I can’t connect to my backend. Please, help.

enter image description here

I’m not sure if this will help, but when I also run node server.js, I also get this error.

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    Solved! I uninstalled mongoose npm uninstall mongoose and re-installed it npm install mongoose.


    1. I had the same issue I forgot to run npm install before running pm2.
    2. Even if you are running a build file, please run npm install.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search