I'm using Visual Studio Code to launch a server for an web application that uses the following packages: nodemon (automatically restarts server), express, ejs, node.js, lodash, morgan, and mongoose.
Every time I activate the server with the following code in the VS Code terminal or I get an error message informing me the port 3000 (one I use for testing) is already in use. I found a solution to solve this in the windows command prompt by entering in terminal. But I find this repetitive and annoying doing this every single time I update my app.js server code. Is there a more perminent solution to remove the need to type in the windows command prompt terminal?
Windows 10 Visual Studio Code: Version: 1.66.2 (user setup) node:events:498 throw er; // Unhandled 'error' event ^
Error: listen EADDRINUSE: address already in use :::3000 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 (C:\Users\Gamer\Documents\Visual Studio Code repositories\M06 Tutorial Lessons 8-10\node-crash-course-lesson-8\node_modules\express\lib\application.js:635:24) at C:\Users\Gamer\Documents\Visual Studio Code repositories\M06 Tutorial Lessons 8-10\node-crash-course-lesson-8\app.js:10:25Emitted 'error' event on Server instance at: at emitErrorNT (node:net:1357:8) at processTicksAndRejections (node:internal/process/task_queues:83:21) { code: 'EADDRINUSE', errno: -4091, syscall: 'listen', address: '::', port: 3000
