Heya, there seems to be an issue with the web server for testing Babylon not shutting down properly. When I try to start it again, I get the “address already in use” error. Or maybe I’m doing something wrong? I’m using (Ctrl + C) to stop the server, like the guide says (in the “Test and Debug” section). Edit: for now, I’m just closing and restarting the CLI before starting the server again…
Here is the CLI output after starting the server and stopping it with (Ctrl + C)
[18:30:01] webpack is watching for changes
^C
sh-3.2# [12:09:31] Server stopped
[12:09:31] The following tasks did not complete: run, webserver
[12:09:31] Did you forget to signal async completion?
And here is the CLI output when I try to start the server again:
[12:12:20] Server started http://localhost:1338
[12:12:20] Running server
[12:12:20] 'webserver' errored after 21 ms
[12:12:20] Error: listen EADDRINUSE: address already in use 127.0.0.1:1338
at Server.setupListenHandle [as _listen2] (net.js:1320:16)
at listenInCluster (net.js:1368:12)
at GetAddrInfoReqWrap.doListen (net.js:1505:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:71:8)
at GetAddrInfoReqWrap.callbackTrampoline (internal/async_hooks.js:131:17)
[12:12:20] 'run' errored after 1.17 s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! babylonjs-gulp@0.0.0 start: `gulp run --max-old-space-size=8192 "run"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the babylonjs-gulp@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /var/root/.npm/_logs/2021-09-15T19_12_20_828Z-debug.log
Really it works well enough to just leave it running, and if I close the CLI I can start it again when I need to. I was just worried maybe there was a bug or maybe I did something wrong
Is it happening if you stop the server and immediately start it? There is a 3 minutes gap between stopping and starting. In my case there were several hours… 3 minutes is enough for a lot of things EDIT: Ok, this was an idiotic question
I started to test this and I think it behaves correctly with Administrator rights, it has correctly stopped the server, however w/o admin I got that message I posted before. On Windows obviously
That’s interesting, “npm run start” fails as normal user, so I’ve been using “sudo npm run start”. Is that the recommonded usage I wonder? Or maybe I installed it with the wrong user/permissions?