Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: listen EADDRINUSE: address already in use :::4000 #594

Closed
deadcoder0904 opened this issue Sep 24, 2019 · 4 comments
Closed

Error: listen EADDRINUSE: address already in use :::4000 #594

deadcoder0904 opened this issue Sep 24, 2019 · 4 comments

Comments

@deadcoder0904
Copy link

@deadcoder0904 deadcoder0904 commented Sep 24, 2019

Basically my port is in use, it should however show an option to open another port just like create-react-app does it :)

@divyenduz

This comment has been minimized.

Copy link
Contributor

@divyenduz divyenduz commented Sep 24, 2019

Which command is this? This very likely looks like a app level code. None of the Prisma tools run anything on 4000 afaik 🤔🙏

@deadcoder0904

This comment has been minimized.

Copy link
Author

@deadcoder0904 deadcoder0904 commented Sep 24, 2019

Ohh shit, idk what i was smoking 😂

But to confirm where do we put the PORT at? Here's my code.

It's just a GraphQL API boilerplate (without auth) but the PORT is only specified in console.log here

@divyenduz

This comment has been minimized.

Copy link
Contributor

@divyenduz divyenduz commented Sep 24, 2019

@deadcoder0904 Default port of yoga is 4000, this is still not related to any core Prisma tools. Please feel free to close it :)

@deadcoder0904

This comment has been minimized.

Copy link
Author

@deadcoder0904 deadcoder0904 commented Sep 24, 2019

Found the solution on https://github.com/prisma/graphql-yoga.

I changed the code to change the default PORT -

const opts = {
  port: 4001,
}

server.start(opts, ({ port }) =>
  console.log(
    `🚀 Server ready at: http://localhost:${port}\n⭐️ See sample queries: http://pris.ly/e/js/graphql#6-using-the-graphql-api`,
  ),
)

This can be added to the GraphQL example as I think beta testers are running multiple applications at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.