npm run develop results in address already in use 127.0.0.1:xxxx
See original GitHub issueThis happens with the starter as well as customized apps.
Checking via netstat -a
on Windows the ports in question all seem to be open and available, and although I am using the standard dev port 8000, I get the following error:
⠋ gatsby-source-wordpress pull updates since last build
Error: listen EADDRINUSE: address already in use 127.0.0.1:63955
at Server.setupListenHandle [as _listen2] (net.js:1318:16)
at listenInCluster (net.js:1366:12)
at GetAddrInfoReqWrap.doListen (net.js:1503:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:8)
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1345:8)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'EADDRINUSE',
errno: -4091,
syscall: 'listen',
address: '127.0.0.1',
port: 63955
}
This happens with any other manually entered port as well. A fresh install may work for a bit but eventually fails as well. I have predominantly noticed this after changing Wordpress data and restarting the process, but can’t confirm that it only happens after changing data.
I am using a docker setup, but the problem persists when using Local by Flywheel
version: "3.8"
services:
db:
image: mariadb:10.5.8
restart: always
volumes:
- db-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
ports:
- 3306:3306
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "3000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
- wordpress:/var/www/html
adminer:
image: adminer
restart: always
ports:
- 8080:8080
volumes:
db-data:
wordpress:
Gatsby config:
plugins: [
{
resolve: "gatsby-source-wordpress-experimental",
options: {
url: "http://localhost:3000/graphql",
},
// removed the other plugins for brevity
],
And versions (again edited for brevity):
"dependencies": {
"gatsby": "^2.31.1",
"gatsby-source-wordpress-experimental": "^7.0.3",
"react": "^17.0.1",
"react-dom": "^17.0.1",
},
I don’t know where the process gets this port from 127.0.0.1:63955, since I either don’t specify it or stick to something shorter (e.g. -p 4000). I’ve also noticed that once the develop script is done and the dev url is shown, the process starts over as if it has trouble persisting the changes.
If I am forgetting anything please let me know and I will edit the post promptly. I have found similar posts but they always showed that the specified port was in use.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:28 (9 by maintainers)
Top GitHub Comments
Hi there, it looks like several users are impacted by this bug, we’re prioritizing it and hope to have a fix in the next month. Completely unrelated, but in the meantime we’re working on a significant rewrite of CMS Preview 🎉
@TylerBarnes This worked for me!! Thank you so much. This was causing quite the headache!