when i run npm dev which is concurrently opens localhost 3000 which does not contain my project

693 views Asked by At

"scripts": { "start": "react-scripts start", "server": "nodemon server ", "client": "npm start --prefix client ", "dev": "npx concurrently "npm run server" "npm run client""

This is the code on my server package json when I npm run dev it opens localhost 3000 which should have my frontend application but instead opens a new react app local host 3000

If I log into my frontend and run,it runs successfully on local host 3000 or sometimes claims that local host 3000 is occupied and changes the port number to local host 3001

I need For the npm run dev to open both client and server concurrently therefore opening the correct localhost 3000 which contains project interface

1

There are 1 answers

1
Sardar On

I believe you are trying to run both processes on the same PORT.Well it is not convenient to run two process on a single port concurrently you need to specify two distinct PORTs for each process.

Refer: Can two applications listen to the same port?