Cannot kill running process - node.js

I have a TypeScript Express application inside an Ubuntu 20.x server and I just did a code update and when I attempt to run a node build/app.js, I get the following error:
> > node build/app.js
>
> node:events:498
> throw er; // Unhandled 'error' event
> ^
>
> Error: listen EADDRINUSE: address already in use :::8080
> at Server.setupListenHandle [as _listen2] (node:net:1330:16)
> at listenInCluster (node:net:1378:12)
> at Server.listen (node:net:1465:7)
> at Function.listen (/home/ubuntu/wmui/service-integration/node_modules/express/lib/application.js:618:24)
> at Object.<anonymous> (/home/ubuntu/wmui/service-integration/build/app.js:70:5)
> at Module._compile (node:internal/modules/cjs/loader:1103:14)
> at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
> at Module.load (node:internal/modules/cjs/loader:981:32)
> at Function.Module._load (node:internal/modules/cjs/loader:822:12)
> at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) Emitted 'error' event on Server
> instance at:
> at emitErrorNT (node:net:1357:8)
> at processTicksAndRejections (node:internal/process/task_queues:83:21) { code: 'EADDRINUSE',
> errno: -98, syscall: 'listen', address: '::', port: 8080 }
I run sudo lsof -i :8080 and then get the pid and then run kill -9 <PID>, but that does absolutely nothing.
What next?
I have also tried this command: kill $(lsof -t -i:8080) and this command: kill -9 $(lsof -t -i:8080)
When I run another lsof -i:8080 I no longer see it listening to 8080, it just says:
node\x20/ 82822 user 21u IPv6 123456 0t0 TCP *:http-alt(LISTEN)

Related

Problem running bassmaster /examples/batch.js in my local machine

Node js version : v18.13.0
npm version: 8.19.3
Cmd : node .\node_modules\bassmaster\examples\batch.js
Os : Windows 10
Error: settings.routes = Config.enable(settings.routes);
^
TypeError: Cannot create property 'routes' on number '8080'
at internals.setup (G:\RCE_Bassmaster\node_modules\hapi\lib\core.js:595:21)
at new module.exports.internals.Core (G:\RCE_Bassmaster\node_modules\hapi\lib\core.js:54:46)
at new module.exports (G:\RCE_Bassmaster\node_modules\hapi\lib\server.js:22:18)
at internals.main (G:\RCE_Bassmaster\node_modules\bassmaster\examples\batch.js:65:22)
at Object. (G:\RCE_Bassmaster\node_modules\bassmaster\examples\batch.js:88:11)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
I was expecting the server to start

electrode-server throwing hapi webpack error

I am trying run this app locally using the below run command, and I am getting errors with starting the electrode server. I am rather new to this so please let me know what information is necessary in order to diagnose my issue. Thank you in advance for any help.
Relevant Dependencies
"#walmart/electrode-ccm-client": "3.3.1",
"#walmart/electrode-quimby-client": "2.0.2",
"#walmart/electrode-ui-config": "3.8.2",
"#walmart/electrode-wml-app": "3.3.5",
"electrode-archetype-react-app": "6.5.4",
"hapi": "^17.0.0",
- Dev -
"#walmart/electrode-build-utils": "^1.1.0",
"electrode-archetype-react-app-dev": "6.5.4",
"webpack-bundle-analyzer": "^3.7.0"
Run command:
NODE_TLS_REJECT_UNAUTHORIZED=0 clap dev
Terminal output:
Starting Electrode webpack dev server
electrode-server caught an error while starting your server
failed registering your plugin 'webpackDevHapi' with module '"./dev-hapi.js"' from path: 'CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin'
message: Invalid plugin options {
"__name": "webpackDevHapi",
"module": "./dev-hapi.js",
"requireFromPath": "CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin"
}
[1] "attributes" is required
Suggestion to resolve the issue:
Please double check and verify your plugin 'webpackDevHapi'.
If you have followed this resolution step and you are still seeing an
error, please file an issue on the electrode-server repository
git+https://github.com/electrode-io/electrode-server.git
Error: Invalid plugin options {
"__name": "webpackDevHapi",
"module": "./dev-hapi.js",
"requireFromPath": "CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin"
}
[1] "attributes" is required
at Object.exports.assert (CWD/node_modules/electrode-server/node_modules/hoek/lib/index.js:740:11)
at Object.exports.apply (CWD/node_modules/electrode-server/node_modules/hapi/lib/schema.js:17:10)
at module.exports.internals.Server.internals.Plugin.register (CWD/node_modules/electrode-server/node_modules/hapi/lib/plugin.js:216:25)
at CWD/node_modules/electrode-server/lib/electrode-server.js:238:16
at CWD/node_modules/electrode-server/lib/electrode-server.js:237:29
From previous event:
at registerPlugins (CWD/node_modules/electrode-server/lib/electrode-server.js:234:20)
From previous event:
at startElectrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:294:6)
at CWD/node_modules/electrode-server/lib/electrode-server.js:365:14
From previous event:
at start (CWD/node_modules/electrode-server/lib/electrode-server.js:354:71)
at processImmediate (internal/timers.js:464:21)
From previous event:
at electrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:412:6)
at Object.<anonymous> (CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin/dev-server.js:23:3)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47
Unhandled rejection Error: Invalid plugin options {
"__name": "webpackDevHapi",
"module": "./dev-hapi.js",
"requireFromPath": "CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin"
}
[1] "attributes" is required
at Object.exports.assert (CWD/node_modules/electrode-server/node_modules/hoek/lib/index.js:740:11)
at Object.exports.apply (CWD/node_modules/electrode-server/node_modules/hapi/lib/schema.js:17:10)
at module.exports.internals.Server.internals.Plugin.register (CWD/node_modules/electrode-server/node_modules/hapi/lib/plugin.js:216:25)
at CWD/node_modules/electrode-server/lib/electrode-server.js:238:16
at CWD/node_modules/electrode-server/lib/electrode-server.js:237:29
From previous event:
at registerPlugins (CWD/node_modules/electrode-server/lib/electrode-server.js:234:20)
From previous event:
at startElectrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:294:6)
at CWD/node_modules/electrode-server/lib/electrode-server.js:365:14
From previous event:
at start (CWD/node_modules/electrode-server/lib/electrode-server.js:354:71)
at processImmediate (internal/timers.js:464:21)
From previous event:
at electrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:412:6)
at Object.<anonymous> (CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin/dev-server.js:23:3)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47
Electrode webpack dev server exited code 0 - signal null

How can I debug my koa program with IDEA?

I need your help.
I can run my program but I can't use debug tool. When I click debug button it shows that there is something wrong. I can't figure it out. I use IDEA to debug my koa program.
If I need do something before debugging?
Debugger listening on ws://127.0.0.1:14967/66cdd084-feab-406a-924f-42d8d3c41141
For help, see: https://nodejs.org/en/docs/inspector
Error in JetBrains node debug connector: Error: spawnSync C:/Program Files/nodejs/node.exe ENOENT
at Object.spawnSync (internal/child_process.js:1041:20)
at spawnSync (child_process.js:616:24)
at execFileSync (child_process.js:643:15)
at Object.<anonymous> (C:\Users\dvdx\AppData\Local\Temp\debugConnector.202.6397.94.js:36:3)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at Module._preloadModules (internal/modules/cjs/loader.js:1298:12) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawnSync C:/Program Files/nodejs/node.exe',
path: 'C:/Program Files/nodejs/node.exe',
spawnargs: [
'C:\\Users\\dvdx\\AppData\\Local\\Temp\\debugConnector.202.6397.94.js'
],
error: [Circular],
status: null,
signal: null,
output: null,
pid: 0,
stdout: null,
stderr: null
}

pm2 logs error port:3000 please fix this error

/Users/jake/.pm2/logs/main-error.log last 15 lines:
0|main | at listenInCluster (net.js:1356:12)
0|main | at Server.listen (net.js:1444:7)
0|main | at Object.<anonymous> (/Users/jake/Desktop/Nodejs-master/main.js:143:5)
0|main | at Module._compile (internal/modules/cjs/loader.js:1139:30)
0|main | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1159:10)
0|main | at Module.load (internal/modules/cjs/loader.js:988:32)
0|main | at Function.Module._load (internal/modules/cjs/loader.js:896:14)
0|main | at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:32:23)
0|main | at Module._compile (internal/modules/cjs/loader.js:1139:30) {
0|main | code: 'EADDRINUSE',
0|main | errno: -48,
0|main | syscall: 'listen',
0|main | address: '::',
0|main | port: 3000
0|main | }
pm2 start main.js --watch works but when i try pm2 logs i got above error
anyone please help to fix this error thanks
EADDRINUSE means this port is already being used by some other application. Maybe a node is already running on this port.
First, run sudo pkill -9 node and use pm2. If this doesn't solve your problem, then ->
kill -9 $(sudo lsof -t -i:3000)

Heroku App Crashing with Syntax Error for Hoek

I'm trying to build the Slack app found here: https://github.com/shaykalyan/slack-ascii
It builds successfully, but gives this output when I try to run it:
2018-02-14T16:21:18.323723+00:00 heroku[web.1]: Starting process with command `node index.js`
2018-02-14T16:21:20.151317+00:00 heroku[web.1]: State changed from starting to crashed
2018-02-14T16:21:20.137708+00:00 heroku[web.1]: Process exited with status 1
2018-02-14T16:21:20.085005+00:00 app[web.1]: /app/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
2018-02-14T16:21:20.085023+00:00 app[web.1]: const Hoek = require('hoek');
2018-02-14T16:21:20.085025+00:00 app[web.1]: ^^^^^
2018-02-14T16:21:20.085027+00:00 app[web.1]: SyntaxError: Use of const in strict mode.
2018-02-14T16:21:20.085028+00:00 app[web.1]: at exports.runInThisContext (vm.js:73:16)
2018-02-14T16:21:20.085030+00:00 app[web.1]: at Module._compile (module.js:443:25)
2018-02-14T16:21:20.085032+00:00 app[web.1]: at Object.Module._extensions..js (module.js:478:10)
2018-02-14T16:21:20.085034+00:00 app[web.1]: at Module.load (module.js:355:32)
2018-02-14T16:21:20.085035+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2018-02-14T16:21:20.085037+00:00 app[web.1]: at Module.require (module.js:365:17)
2018-02-14T16:21:20.085038+00:00 app[web.1]: at require (module.js:384:17)
2018-02-14T16:21:20.085040+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/request/node_modules/hawk/lib/index.js:5:33)
2018-02-14T16:21:20.085042+00:00 app[web.1]: at Module._compile (module.js:460:26)
2018-02-14T16:21:20.085043+00:00 app[web.1]: at Object.Module._extensions..js (module.js:478:10)

Resources