skip to Main Content

i cloned a repository from github , i performed the following steps
Clone the repository:

git clone https://github.com/AnshNagpal0/ChitChat.git

Navigate to the project directory:

cd mern-chat-app

Install dependencies for both server and client:

npm install
cd client
npm install

Create a .env file in the root directory and set environment variables (e.g., MongoDB connection string, JWT secret).

Start the server:

npm start

Start the client:

cd client
npm start

Visit http://localhost:3000 in your browser to use the application. i installed mongodb without compass but i am getting localhost 3000 refused to connect

i am stuck in this.
npm start in the root giving this

C:UsersaaravOneDriveDesktopmern chat appChitChat>npm start

> [email protected] start
> node backend/server.js

server now running on port 5000
(node:1532) [MONGODB DRIVER] Warning: useNewUrlParser is a deprecated option: useNewUrlParser has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1532) [MONGODB DRIVER] Warning: useUnifiedTopology is a deprecated option: useUnifiedTopology has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version
Error: connect ECONNREFUSED ::1:27017

2

Answers


  1. works totally fine, go to frontent and run npm start to start client on port 3000

    to start backend run npm start on root directory.

    advice – hide your mongodb url, should not upload it publically.

    Login or Signup to reply.
  2. Looks like the application is not able to connect to mongodb.
    Make sure that the mongodb process is actually running.

    On linux you can check if mongodb is running with:

    systemctl status mongod
    

    If it’s not, start it with:

    sudo systemctl start mongod
    

    For windows ensure that you have the C:datadb folder setup.
    You can read more on the windows installation process here https://www.mongodb.com/docs/v3.0/tutorial/install-mongodb-on-windows/

    Then navigate to the C:Program FilesMongoDBServer3.2bin in cmd and run the command mongod to start the database

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search