We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I try to run a node code the sub process is not being killed.
This is my npm script:
"scripts": { "watch": "npx watch --interval=1 'node src/index.js' src" },
This is a minimal version of the app:
const express = require('express'); const PORT = 3000; const HOST = 'localhost'; const app = express(); // Run app.listen(PORT, HOST, ()=>{ console.log(`Listening: ${HOST}:${PORT}`); });
This is the error I get:
$ npm run watch > iplogger@1.0.0 watch > npx watch --interval=1 'node src/index.js' src > Watching src Listening: localhost:3000 # Affter save the file node:events:492 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE: address already in use 127.0.0.1:3000 at Server.setupListenHandle [as _listen2] (node:net:1872:16) at listenInCluster (node:net:1920:12) at GetAddrInfoReqWrap.doListen [as callback] (node:net:2069:7) at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:8) Emitted 'error' event on Server instance at: at emitErrorNT (node:net:1899:8) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { code: 'EADDRINUSE', errno: -98, syscall: 'listen', address: '127.0.0.1', port: 3000 } Node.js v20.9.0
How can I tell the watch command to kill the previous process before starting a new?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I try to run a node code the sub process is not being killed.
This is my npm script:
This is a minimal version of the app:
This is the error I get:
How can I tell the watch command to kill the previous process before starting a new?
The text was updated successfully, but these errors were encountered: