Lately, I installed Node latest LTS 2.11 version to test a very simple Node application locally (i.e localhost) using Express API code base where I tried to execute a GET call through (any) 'Browser' and Postman.
But the request had never been able to reach the server where as the server was on!
I was very confused and worried about my antivirus, windows firewall etc etc.
Later, spending so many hours, I uninstalled v20.11 and reinstalled v18.19 and everything started working!
So, it seems like there is a problem/bug in v20.11!!!
Here is the code...
//api.js
const express = require("express");
const server = express();
server.get("/api", (req, res) => {
console.log("request data:", req);
res.send("Server: I am listening.");
});
const port = 8080;
server.listen(port, () => {
console.log(Server is running on port ${port});
});
//packages.json
{
"name": "api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2"
}
}
Ran as http://localhost:8080/api
Though things are working well in v18.19, but would like to receive all of your feedbacks regarding not working in v20.11.
Top comments (0)