pnp/docker-spfx

workbench issue "EADDRINUSE" error while running gulp serve

sudhir007rawat opened this issue · 4 comments

Getting "EADDRINUSE" error while running gulp serve. Here are the gulp serve logs.

$ gulp serve
Build target: DEBUG
[18:12:19] Using gulpfile /usr/app/spfx/gulpfile.js
[18:12:19] Starting gulp
[18:12:19] Starting 'serve'...
[18:12:19] Starting subtask 'configure-sp-build-rig'...
[18:12:19] Finished subtask 'configure-sp-build-rig' after 51 ms
[18:12:19] Starting subtask 'spfx-serve'...
[18:12:19] [spfx-serve] To load your scripts, use this query string: ?debug=true&noredir=true&debugManifestsFile=https://0.0.0.0:4321/temp/manifests.js
[18:12:22] Starting server...
Starting api server on port 5432.
Registring api: /workbench
Registring api: /
[18:12:26] Finished subtask 'spfx-serve' after 7.78 s
[18:12:26] Starting subtask 'pre-copy'...
[18:12:27] Finished subtask 'pre-copy' after 676 ms
[18:12:27] Starting subtask 'copy-static-assets'...
[18:12:27] Starting subtask 'sass'...
{ Error: listen EADDRINUSE: address already in use :::5432
at Server.setupListenHandle [as _listen2] (net.js:1280:14)
at listenInCluster (net.js:1328:12)
at Server.listen (net.js:1415:7)
at SpfxServeTask.executeTask (/usr/app/spfx/node_modules/@microsoft/gulp-core-build-serve/lib/ServeTask.js:70:65)
at SpfxServeTask.executeTask (/usr/app/spfx/node_modules/@microsoft/sp-build-core-tasks/lib/spfxServe/SpfxServeTask.js:41:22)
at Promise (/usr/app/spfx/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.js:171:31)
at new Promise ()
at SpfxServeTask.execute (/usr/app/spfx/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.js:163:16)
at _executeTask (/usr/app/spfx/node_modules/@microsoft/gulp-core-build/lib/index.js:356:44)
at output.then (/usr/app/spfx/node_modules/@microsoft/gulp-core-build/lib/index.js:254:44)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'listen',
address: '::',
port: 5432 }
[18:12:27] Error - Unknown
listen EADDRINUSE: address already in use :::5432
{ Error: listen EADDRINUSE: address already in use 0.0.0.0:4321
at Server.setupListenHandle [as _listen2] (net.js:1280:14)
at listenInCluster (net.js:1328:12)
at doListen (net.js:1461:7)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'listen',
address: '0.0.0.0',
port: 4321 }
[18:12:27] Error - Unknown
listen EADDRINUSE: address already in use 0.0.0.0:4321
[18:12:27] Opening https://localhost:5432/workbench using the default OS app
(node:252) UnhandledPromiseRejectionWarning: Error: Exited with code 3
at ChildProcess.cp.once.code (/usr/app/spfx/node_modules/opn/index.js:84:13)
at Object.onceWrapper (events.js:286:20)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Socket.stream.socket.on (internal/child_process.js:389:11)
at Socket.emit (events.js:198:13)
at Pipe._handle.close (net.js:607:12)
(node:252) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:252) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[18:12:27] Finished subtask 'copy-static-assets' after 278 ms
[18:12:28] ==================[ Finished ]==================
Error - Unknown
listen EADDRINUSE: address already in use :::5432
Error - Unknown
listen EADDRINUSE: address already in use 0.0.0.0:4321
[18:12:28] Finished subtask 'sass' after 1.23 s
[18:12:28] Starting subtask 'tslint'...
[18:12:38] [tslint] tslint version: 5.12.1
[18:12:38] Starting subtask 'tsc'...
[18:12:38] [tsc] typescript version: 3.3.4000
[18:12:38] Project spfx version:0.0.1
[18:12:38] Build tools version:3.12.1
[18:12:38] Node version:v10.18.1
[18:12:38] Total duration:1.55 min
[18:12:38] Task errors:4
[18:12:58] Finished subtask 'tsc' after 21 s
[18:12:59] Finished subtask 'tslint' after 31 s
[18:12:59] Starting subtask 'post-copy'...
[18:12:59] Finished subtask 'post-copy' after 580 μs
[18:12:59] Starting subtask 'collectLocalizedResources'...
[18:12:59] Finished subtask 'collectLocalizedResources' after 7.76 ms
[18:12:59] Starting subtask 'configure-webpack'...
[18:13:08] Finished subtask 'configure-webpack' after 8.55 s
[18:13:08] Starting subtask 'webpack'...
[18:13:32] Finished subtask 'webpack' after 24 s
[18:13:32] Starting subtask 'configure-webpack-external-bundling'...
[18:13:32] Finished subtask 'configure-webpack-external-bundling' after 1.43 ms
[18:13:32] Starting subtask 'copy-assets'...
[18:13:32] Finished subtask 'copy-assets' after 103 ms
[18:13:32] Starting subtask 'write-manifests'...
[18:13:45] Finished subtask 'write-manifests' after 13 s
[18:13:45] Starting subtask 'reload'...
[18:13:45] Finished subtask 'reload' after 1.85 ms

what SPFx version was this project created with and what docker image are you using?

@sudhir007rawat could it be that there's something else running on port 5432 on your machine?

Could you help us replicate this issue @sudhir007rawat?

Closing due to lack of activity