{ [Issue: port 5000 already in use]

I'm encountering an issue with my Server.JS file while trying to connect Deployd to Heroku. Despite configuring the mongoDB port to 5000 in Nitrous, I keep getting an error. Any assistance would be greatly appreciated. Thank you!

Server.JS

// require deployd
var deployd = require('deployd');

// database configuration 
var server = deployd({
  port: process.env.PORT || 5000,
  env: 'production',
  db: {
    host: '0.0.0.0',
    port: 5000,
    name: 'database_name',
    credentials: {
      username: 'username',
      password: 'password'
    }
  }
});

// setting up sockets for Heroku
server.sockets.server.set('transports', ["xhr-polling"]);

// start the server
server.listen();

// debugging
server.on('listening', function() {
 console.log("Server is listening on port: " + process.env.PORT);
});

// Error handling for Deployd
server.on('error', function(err) {
  console.error(err);
  process.nextTick(function() { // Ensure proper error handling
    process.exit();
  });
});

ERROR:

 db:error Error: Cannot open store: MongoError: server 0.0.0.0:5000 timed out
 at /home/nitrous/Find-Volunteerships/node_modules/deployd/lib/db.js:144:17
...

{ [Error: listen EADDRINUSE :::5000]
 code: 'EADDRINUSE',
  errno: 'EADDRINUSE',
  syscall: 'listen',
  address: '::',
  port: 5000 }

Answer №1

It appears that both servers are currently sharing the same port. Fortunately, you can resolve this issue by using the following command:

netstat -ano|findstr "PID :5000"

The port number to focus on is 5000.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Mastering the Art of Destructuring within React Components

After extensive research online, I still struggle to fully grasp destructuring, although I'm getting there. //before destructuring function me(details){ console.log('My name is ' + details.name + ' and I work for ' + details.com ...

Retrieve all items pertaining to a specific week in the calendar

I'm trying to obtain a list of week ranges for all data in my MongoDB. When a week range is clicked, only the records for that specific week range should be displayed. By clicking on the week range, the ID of the week (let's say 42, representing ...

Exploring the functionality of AngularJS routing on a webpage

Testing the routing functionality of AngularJS while creating a web page. The index.html will contain links to Home, Courses, and Students. Clicking on each link will load its respective HTML using AngularJS routing. The student information is stored in ...

Steps to include a HTML webpage within another page

I need assistance with a scenario involving two separate HTML pages on different servers. Merchant Form - Server A Payment Form - Server B Here's the desired scenario: The user completes all necessary fields on the Merchant Form and clicks submit. ...

Update the Express-Handlebars helper functions by organizing them into individual files

I am currently using Express-Handlebars and am looking to streamline this code by separating it into different files const express = require('express'); const exphbs = require('express-handlebars'); const handlebars = exph ...

What is the process for removing a cookie in the MEAN stack?

I am facing an issue with deleting a cookie from my Node API in my Angular client (MEAN stack). On the Node side, I have a controller and a router set up, while on Angular, I subscribe to the service. // node router authRouter.get('/logout', t ...

Switching Image Values in JavaScript: A Quick Guide

After successfully using a JavaScript function to swap the src of two images, I encountered an issue. I also needed to switch two values associated with the images so that I could calculate them later. For example: img src="ble.jpg" id="F" value="" onclic ...

React Js Pokédex API Project

I am currently in the process of learning how to use React and attempting to load the API onto my pokedex app. Here is the link to the API: . My goal is to load every pokemon on the (pokemon_entries) list, but I am unsure of how to go about this. Previous ...

Validating Forms in AngularJS: Ensuring At Least One Input Field is Not Empty

Consider the following basic HTML form: <form name="myForm" action="#sent" method="post" ng-app> <input name="userPreference1" type="text" ng-model="shipment.userPreference" /> <input name="userPreference2" type="text" ng-model="shipm ...

Activate video in Slick Slider with the click of a button

I am facing an issue with my slider setup, where each slide contains a video as the background along with play/pause buttons. When I try to play the video by clicking the corresponding button on a specific slide, I encounter this problem: if I click the pl ...

Amend the value in the database

I am looking to adjust a value in my database by clicking on an image on my webpage. Can someone guide me on how to achieve this using JavaScript and AJAX? ...

Posting an array using a single input in Angular

When trying to post a list of numbers using the code below in an Angular tags input field, only one number from the list is being posted: HTML <tags-input placeholder="{{placeholder}}" min-length="1" ma ...

The Veux Store is throwing an error message that says "Array is

When retrieving data from the Vuex Store, I start by checking if the array is present. Following that, my next step is to verify whether the noProducts object at index 0 exists. This validation process is important because the tweakwiseSortedProducts vari ...

What is causing the malfunction of Vue's method?

I'm attempting to create a Vue method, and I've encountered an issue where 'clickA' does not function, but 'clickB' does. Can someone explain why this is happening? It's important that the solution allows the throttle fu ...

Failure occurs when attempting to utilize external .js and .css files

As I embark on creating a website using Bootstrap, I stumbled upon a registration page code that consists of three files - HTML, CSS, and .js. registration.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> ...

Chrome does not allow accessing or setting the `scrollTop()` property for elements with `position: absolute`

When using the JS Fiddle provided, it was discovered that clicking the link in the sidebar scrolls the page to 400px down in Firefox, but this functionality does not work in Chrome. Check out the JS Fiddle here If I am unable to modify the HTML or CSS, i ...

Determine the week number based on a specified starting day for the week

If I have a custom week start day other than Monday, how should the getWeekNumber() prototype for the Date class be modified? Here is the existing code for calculating the ISO Week Number: Date.prototype.getWeekNumber = function() { // Create a dupli ...

Guide to activating the isActive status on a live link within a map iteration utilizing the NEXTUI navigation bar

Check out the new NEXTUI navbar I'm using: I am having trouble setting the isActive property on the active link in my NavBar component in Next.js. I couldn't find much help on Google, so I'm hoping someone here has experience with this or k ...

Understanding how to break down intricate JSON strings into classes using either VB or C# programming languages

I have a JSON string that needs to be parsed and eventually stored in database tables. My plan is to parse it into VB .NET classes (objects) and then store the data in the tables. I have Newtown imported into my .NET environment, but I'm not very fami ...

Maintain daily data that can be updated in JSON format

I'm working on a web application that utilizes client-side MVC with backbone.js and Spring on the server side. I have a scenario where I require data that needs to be updated daily or every couple of days. The data will be used on the client side for ...