简体   繁体   中英

Requrie stack error when using nginx and pm2

I am using WinSCP and Nginx to host my application but I keep on getting this error when I check the logs of pm2 I checked my WinSCP and it says it contains all folders so it doesn't seem to have anything missing

/home/***/.pm2/logs/server-error.log last 15 lines:
0|server   | Require stack:
0|server   | - /home/***/server.js
0|server   |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
0|server   |     at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29)
0|server   |     at require (internal/modules/cjs/helpers.js:88:18)
0|server   |     at Object.<anonymous> (/home/*****/server.js:8:22)
0|server   |     at Module._compile (internal/modules/cjs/loader.js:1063:30)
0|server   |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
0|server   |     at Module.load (internal/modules/cjs/loader.js:928:32)
0|server   |     at Function.Module._load (internal/modules/cjs/loader.js:769:14)
0|server   |     at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
0|server   |     at Module._compile (internal/modules/cjs/loader.js:1063:30) {
0|server   |   code: 'MODULE_NOT_FOUND',
0|server   |   requireStack: [ '/home/****/server.js' ]
0|server   | }

I am unsure of what the "require stack" error means and I am unsure of how to handle it. Can someone point me in the right direction? If you need more information please let me know.

It's a stack trace. Your underlying error is an attempt to require() a module that doesn't exist.

Node's stack traces for require() failures are notorious for their uselessness. Ignore them. Just figure out which module is missing, and fix it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM