"Connection Refused" error during exp build

I’m trying to build for iOS for my first time using expo, and I keep running into the same problem. Every time I run exp build:ios, I end up getting a “connection refused” error, which terminates the build process. The error message is very undescriptive, so I’m not sure what actions to take to resolve the issue. Here’s the build logs with the stacktrace:

[07:02:56] Using existing credentials for this build
[07:02:56] Publishing to channel 'default'...
[07:02:58] Building iOS bundle
[07:02:59] Error: connect ECONNREFUSED 127.0.0.1:19001
[07:02:59] RequestError: Error: connect ECONNREFUSED 127.0.0.1:19001
    at new RequestError (C:\Users\miles\AppData\Roaming\npm\node_modules\exp\node_modules\request-promise-core\lib\errors.js:14:15)
    at Request.plumbing.callback (C:\Users\miles\AppData\Roaming\npm\node_modules\exp\node_modules\request-promise-core\lib\plumbing.js:87:29)
    at Request.RP$callback [as _callback] (C:\Users\miles\AppData\Roaming\npm\node_modules\exp\node_modules\request-promise-core\lib\plumbing.js:46:31)
    at self.callback (C:\Users\miles\AppData\Roaming\npm\node_modules\exp\node_modules\request\request.js:185:22)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at Request.onRequestError (C:\Users\miles\AppData\Roaming\npm\node_modules\exp\node_modules\request\request.js:881:8)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at Socket.socketErrorListener (_http_client.js:387:9)

Does anyone know what the problem is here?

Whoops, shortly after posting this I found the solution:

run exp start first then exp publish.

from Error when trying to run exp publish - #8 by zeeshanansari

4 Likes