question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with setting up local environment

See original GitHub issue

Describe the bug:

There are few issues with the local dev environment

  • await initDB() fails silently without starting a server. If I replace the code with the snippet below, it works fine.
  initDB() 
  .then(() => {
    console.log("connected");
  }).catch((err) => {
    console.log(err);
  });
  • yarn both gives me the following error
$ yarn both
yarn run v1.22.5
$ concurrently "yarn dev" "yarn --cwd='./client' dev"
$ ts-node-dev --no-notify -P tsconfig.server.json ./server/app.ts
$ ts-node-dev --no-notify -P tsconfig.server.json ./server/app.ts
[0] ts-node-dev ver. 1.0.0-pre.63 (using ts-node ver. 8.10.2, typescript ver. 3.9.7)
[1] ts-node-dev ver. 1.0.0-pre.63 (using ts-node ver. 8.10.2, typescript ver. 3.9.7)
[1] in module
[0] in module
[1] After express
[0] After express
[0] DB initialized
[1] DB initialized
[0] built schema
[1] built schema
[0] Created server
[0] applied middleware
[0] prepared options.
[1] Created server
[1] applied middleware
[1] prepared options.
[0] Listening on http://localhost:5000/graphql
[1] Error: listen EADDRINUSE: address already in use :::5000
[1]     at Server.setupListenHandle [as _listen2] (net.js:1317:16)
[1]     at listenInCluster (net.js:1365:12)
[1]     at Server.listen (net.js:1451:7)
[1]     at Function.listen (D:\repos\chapter\node_modules\express\lib\application.js
:618:24)
[1]     at D:\repos\chapter\server\app.ts:62:9
[1]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[1] [ERROR] 19:53:59 Error: listen EADDRINUSE: address already in use :::5000

On the other hand, running both the servers in seperate terminals worked fine for me.

Tell us about your browser and operating system:

  • Browser(s) name and version:
  • Operating System: Windows 10 Home edition
  • Node Version: 14.13.10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rahul1990guptacommented, Oct 25, 2020

@allella The fix works for me on Node 14.13.0. Thanks.

0reactions
allcontributors[bot]commented, Apr 27, 2021

@allella

I’ve put up a pull request to add @rahul1990gupta! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are some problems in setting up local developer ... - Quora
The main issue is to have conformity in the setup between production and development systems, and thus between development systems.
Read more >
How to set up a local development environment - Creative Bloq
A local environment will let you focus on code and the fun bits of building websites.
Read more >
Don't be stuck at dev environment setup! | Rookie's Lab
This is my favorite problem to fix whenever I start on any new project. Worst case scenario is, there's no db migration history,...
Read more >
Best Practices Setting up Your Local Development Environment
Setting up your local development environment can be done in many different ways. This post presents different methods and best practices ...
Read more >
Local Development Environment Setup for Windows
In this hands-on lab, you will setup your local web development environment. It will include version control with Git, helper apps, package managers ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found