zachleat / speedlify

Benchmark the web performance and accessibility of sites over time.
https://www.speedlify.dev/
MIT License
919 stars 167 forks source link

Error: connect ECONNREFUSED 127.0.0.1:xxxxx #65

Open 0rangebananaspy opened 1 year ago

0rangebananaspy commented 1 year ago

I'm running on my local virtual server on Proxmox with Ubuntu 22.04 LTS, Node.js v18.16.1. Everytime npm run test-pages give me this error.

> speedlify@1.0.0 test-pages
> node run-tests

There are no known last run timestamps
Skipping fakultas (you told me to in your site config)
First tests for sample.
Testing 6 sites:
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: connect ECONNREFUSED 127.0.0.1:41941
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 41941
}

Node.js v18.16.1

any clue to make it run?

Screenshot: https://imgur.com/bIZDTte

colinmo commented 7 months ago

You'll have to add chromium/chrome browser to your repository. The tool puppets Chrome in order to run the user-experience browser.

ADDED: Note that if you're running as Root, you'll also need to add --no-sandbox to the options in the run-tests.js file.

fienen commented 7 months ago

You'll have to add chromium/chrome browser to your repository. The tool puppets Chrome in order to run the user-experience browser.

ADDED: Note that if you're running as Root, you'll also need to add --no-sandbox to the options in the run-tests.js file.

@colinmo Can you go into a bit more detail on this? I've got Chrome and Chromium both installed on the server, but I'm also getting this same error. When you say "add it to the repo," is that implying something like NPM should be installing it there, because that doesn't seem totally right.

colinmo commented 7 months ago

Sorry for delay.

I found that I had to add chromium/ chrome (either) AND set the environment variable "PUPPETEER_EXECUTABLE_PATH" that tells puppeteer where to run - /usr/bin/chromium-browser in my case. Does that help?

colinmo commented 7 months ago

@colinmo Can you go into a bit more detail on this? I've got Chrome and Chromium both installed on the server, but I'm also getting this same error. When you say "add it to the repo," is that implying something like NPM should be installing it there, because that doesn't seem totally right.

Sorry, in addition to the above answer you don't need to add it to the actual repo. You're right, it's just it needed to be installed where your code can access it. Much more accurate description.