Error: Port already in use:3000 in node.js using socket io and express

Hello everyone!
I was making a node.js application that includes express and

The code I’m using is here-

const express=require('express');
const app=express();
const http=require('http').Server(app);

const io=require('')(http,{

  console.log('listening to port 3000');

//when connection made 
  console.log('connection made!');

Here,public is a folder containing some html files
and I’m getting the error-

Error: listen EADDREINUSE: address already in use :::3000

Basically,a error saying the post 3000 is in use already. Now,as far as i know,port 3000 is available globally
And this code when tested on my pc locally works fine.

Any help regarding this will greatly be appreciated!

Glitch serves projects at port 3000, which might be conflicting with the socket’s port.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.