Hello Brian,
I tried above implementation. But I am keep on getting this error in my setup
tqd-node | 2019-09-17T07:10:40: PM2 log: App [node_app:0] starting in -fork mode- tqd-node | 2019-09-17T07:10:41: PM2 log: App [node_app:0] online tqd-node | { Error: Cannot find module 'dotnev' tqd-node | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) tqd-node | at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:51:29) tqd-node | at require (internal/modules/cjs/helpers.js:22:18) tqd-node | at Object.<anonymous> (/usr/src/app/src/server/index.js:5:17) tqd-node | at Module._compile (internal/modules/cjs/loader.js:701:30) tqd-node | at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) tqd-node | at Module.load (internal/modules/cjs/loader.js:600:32) tqd-node | at tryModuleLoad (internal/modules/cjs/loader.js:539:12) tqd-node | at Function.Module._load (internal/modules/cjs/loader.js:531:3) tqd-node | at Module.require (internal/modules/cjs/loader.js:637:17) code: 'MODULE_NOT_FOUND' } tqd-node | 2019-09-17T07:10:41: PM2 log: App [node_app:0] exited with code [1] via signal [SIGINT] tqd-node | 2019-09-17T07:10:41: PM2 log: Script /usr/src/app/src/main.js had too many unstable restarts (16). Stopped. "errored"
I have installed all the modules you suggested.
[src-tree]
src/ ├── data │ └── index.js ├── elastic.js ├── main.js └── server ├── controllers │ └── index.js ├── index.js ├── models │ └── index.js └── routes └── index.js
[package.json]
{ "name": "nodejs_es_docker", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "start": "pm2-runtime start ./src/main.js --name node_app", "stop": "pm2-runtime stop node_app " }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "@elastic/elasticsearch": "^7.3.0", "body-parser": "^1.19.0", "cors": "^2.8.5", "dotenv": "^8.1.0", "express": "^4.17.1" } }
Could you please help where I am doing wrong.
Thank you.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello Brian,
I tried above implementation. But I am keep on getting this error in my setup
I have installed all the modules you suggested.
[src-tree]
[package.json]
Could you please help where I am doing wrong.
Thank you.