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.

Async example: Error: connect ECONNREFUSED 127.0.0.1:80

See original GitHub issue

HI , I’m on the window 7, when i run npm test in examples/async, it produced errors below:

$ npm test

> @ test D:\study\jest\examples\async
> jest


 RUNS  __tests__\user-test.js
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 127.0.0.1:80
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
npm ERR! Test failed.  See above for more details.

then, I checked the 80 port, but found nothing:

Administrator@USER-20150722FJ D:\study\jest\examples\async      
$ netstat -ano | findstr "127.0.0.1:80"                         

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:10
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
frevibcommented, Dec 9, 2016

@dYb Did you run Jest with --no-cache once, or ran it for the first time with babel-jest > ‘9.0.3’? Which version of Node are you running?

I have this issue with all ^9.0.0 versions of babel-jest ( ‘9.0.1’, ‘9.0.2’, ‘9.0.3’). ‘10.0.1’ works and so does 16 and 17.

edit: tested here on a Windows 10 machine, babel-jest ^9.0.0 not working, 16 and 17 works fine.

4reactions
frevibcommented, Nov 18, 2016

@cpojer You’re right, this isn’t the issue, although it works somehow for me (I’m on OSX Sierra).

The example uses babel-jest ^9.0.0. Upgrading to 16.0.0 and running jest --no-cache once also solved the issue for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest test passed but get Error: connect ECONNREFUSED ...
So I figured out and the solution is quite easy. I can't explain why though. This req.get('api/v1/users/') should be /api/v1/users - you ...
Read more >
Connect ECONNREFUSED 127.0.0.1:80 - Node
it was the index folder I have just named it app. However, I have figured out where the error was it just a...
Read more >
connect econnrefused 127.0.0.1:80 - You.com | The AI Search ...
A lot of Error: Error: connect ECONNREFUSED 127.0.0.1:80 in the console logs when running my tests. But the tests pass most of the...
Read more >
connect ECONNREFUSED 127.0.0.1:3306 solved in Node JS ...
How to fix Error : connect ECONNREFUSED 127.0.0.1:3306 in node js and mysql is shown.
Read more >
connect ECONNREFUSED when integration testing a Node.js ...
Error : connect ECONNREFUSED when integration testing a Node.js app ... Turned out the root cause was a test method that should have...
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