Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module './db.json' #227

Open
loudbirds opened this issue Jun 8, 2017 · 0 comments
Open

Cannot find module './db.json' #227

loudbirds opened this issue Jun 8, 2017 · 0 comments

Comments

@loudbirds
Copy link

loudbirds commented Jun 8, 2017

yarn prod:start v1.24.5
$ cross-env NODE_ENV=production pm2 start lib/server && pm2 logs
[PM2] Applying action restartProcessId on app [server](ids: 0)
[PM2] server
[PM2] Process successfully started
┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │
├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼──────────┤
│ server │ 0 │ fork │ 53589 │ online │ 105 │ 0s │ 0% │ 11.9 MB │ disabled │
└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴──────────┘
Use pm2 show <id|name> to get more details about an app
[TAILING] Tailing last 15 lines for [all] processes (change the value with --lines option)
/Users/ervinbosenbacher/.pm2/pm2.log last 15 lines:
PM2 | 2017-06-08 11:24:55: Starting execution sequence in -fork mode- for app name:server id:0
PM2 | 2017-06-08 11:24:55: App name:server id:0 online
PM2 | 2017-06-08 11:24:55: App [server] with id [0] and pid [53508], exited with code [1] via signal [SIGINT]
PM2 | 2017-06-08 11:24:55: Starting execution sequence in -fork mode- for app name:server id:0
PM2 | 2017-06-08 11:24:55: App name:server id:0 online
PM2 | 2017-06-08 11:24:55: App [server] with id [0] and pid [53511], exited with code [1] via signal [SIGINT]
PM2 | 2017-06-08 11:24:55: Script /Users/ervinbosenbacher/dev/gridsearch/frontend/lib/server had too many unstable restarts (16). Stopped. "errored"
PM2 | 2017-06-08 11:27:24: Starting execution sequence in -fork mode- for app name:server id:0
PM2 | 2017-06-08 11:27:24: App name:server id:0 online
PM2 | 2017-06-08 11:27:24: App [server] with id [0] and pid [53589], exited with code [1] via signal [SIGINT]
PM2 | 2017-06-08 11:27:24: Starting execution sequence in -fork mode- for app name:server id:0
PM2 | 2017-06-08 11:27:24: App name:server id:0 online
PM2 | 2017-06-08 11:27:24: App [server] with id [0] and pid [53594], exited with code [1] via signal [SIGINT]
PM2 | 2017-06-08 11:27:24: Starting execution sequence in -fork mode- for app name:server id:0
PM2 | 2017-06-08 11:27:24: App name:server id:0 online

/Users/ervinbosenbacher/.pm2/logs/server-out-0.log last 15 lines:
0|server | Server running on port 8000 (production).
0|server | Server running on port 8000 (production).
0|server | Server running on port 8000 (production).
0|server | Server running on port 8000 (production).
0|server | Server running on port 8000 (production).
0|server | Server running on port 8000 (production).

/Users/ervinbosenbacher/.pm2/logs/server-error-0.log last 15 lines:
0|server | at Object.Module._extensions..js (module.js:579:10)
0|server | at Module.load (module.js:487:32)
0|server | at tryModuleLoad (module.js:446:12)
0|server | at Function.Module._load (module.js:438:3)
0|server | Error: Cannot find module './db.json'
0|server | at Function.Module._resolveFilename (module.js:469:15)
0|server | at Function.Module._load (module.js:417:25)
0|server | at Module.require (module.js:497:17)
0|server | at require (internal/module.js:20:19)
0|server | at Object. (/Users/ervinbosenbacher/dev/gridsearch/frontend/lib/node_modules/mime-types/node_modules/mime-db/index.js:13:18)
0|server | at Module._compile (module.js:570:32)
0|server | at Object.Module._extensions..js (module.js:579:10)
0|server | at Module.load (module.js:487:32)
0|server | at tryModuleLoad (module.js:446:12)
0|server | at Function.Module._load (module.js:438:3)

[STREAMING] Now streaming realtime logs for [all] processes
0|server | Error: Cannot find module './db.json'
0|server | at Function.Module._resolveFilename (module.js:469:15)
0|server | at Function.Module._load (module.js:417:25)
0|server | at Module.require (module.js:497:17)
0|server | at require (internal/module.js:20:19)
0|server | at Object. (/Users/ervinbosenbacher/dev/gridsearch/frontend/lib/node_modules/mime-types/node_modules/mime-db/index.js:13:18)
0|server | at Module._compile (module.js:570:32)
0|server | at Object.Module._extensions..js (module.js:579:10)
0|server | at Module.load (module.js:487:32)
0|server | at tryModuleLoad (module.js:446:12)
0|server | at Function.Module._load (module.js:438:3)
PM2 | App [server] with id [0] and pid [53598], exited with code [1] via signal [SIGINT]
PM2 | Starting execution sequence in -fork mode- for app name:server id:0
PM2 | App name:server id:0 online
0|server | Error: Cannot find module './db.json'
0|server | at Function.Module._resolveFilename (module.js:469:15)
0|server | at Function.Module._load (module.js:417:25)
0|server | at Module.require (module.js:497:17)
0|server | at require (internal/module.js:20:19)
0|server | at Object. (/Users/ervinbosenbacher/dev/gridsearch/frontend/lib/node_modules/mime-types/node_modules/mime-db/index.js:13:18)
0|server | at Module._compile (module.js:570:32)
0|server | at Object.Module._extensions..js (module.js:579:10)
0|server | at Module.load (module.js:487:32)
0|server | at tryModuleLoad (module.js:446:12)
0|server | at Function.Module._load (module.js:438:3)
PM2 | App [server] with id [0] and pid [53601], exited with code [1] via signal [SIGINT]
PM2 | Starting execution sequence in -fork mode- for app name:server id:0
PM2 | App name:server id:0 online
0|server | Error: Cannot find module './db.json'
0|server | at Function.Module._resolveFilename (module.js:469:15)
0|server | at Function.Module._load (module.js:417:25)
0|server | at Module.require (module.js:497:17)
0|server | at require (internal/module.js:20:19)
0|server | at Object. (/Users/ervinbosenbacher/dev/gridsearch/frontend/lib/node_modules/mime-types/node_modules/mime-db/index.js:13:18)
0|server | at Module._compile (module.js:570:32)
0|server | at Object.Module._extensions..js (module.js:579:10)
0|server | at Module.load (module.js:487:32)
0|server | at tryModuleLoad (module.js:446:12)
0|server | at Function.Module._load (module.js:438:3)
PM2 | App [server] with id [0] and pid [53604], exited with code [1] via signal [SIGINT]
PM2 | Starting execution sequence in -fork mode- for app name:server id:0
PM2 | App name:server id:0 online
....

I have the above output when I am running prod:start after prod:build.

I have tried to npm install the packages into a separate directory and then copy it which partially solved the problem as then I had other Cannot find module errors as well. The last one was flatten-array from express

I am fairly new to Javascript, is this a bug due to some latest packages?
Any help would be much appreciated.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant