Error on startup

app@public-mazz-v6:~ 18:55 
$ node .
  throw er; // Unhandled 'error' event

Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (net.js:1270:14)
at listenInCluster (net.js:1318:12)
at Server.listen (net.js:1405:7)
at Function.listen (/rbd/pnpm-volume/9583b0e3-5d86-4cbb-949e-13826a0f7e48/node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (/app/bot.js:22:5)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1297:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

Having a startup error when running node . / node bot.js in the console. I have looked around on the forums but I can’t find any solution to this. Could anyone help me? Project name = public-mazz-v6 (Private). People are saying to change the port but where do I? Thanks in advance.

When the project container restarts, it probably automatically starts the same code or some other code listening to the same port. The port can only be listened to by one process.

Have a look in package.json scripts start.

You mean this?

You are trying to run code that is already running. As @mishavee said, Glitch automatically runs the command specified in package.json -> scripts -> start when your project (re)starts.

That’s in the image right?

I’ve fixed this issue by changing the port in .env, but I need to change the port every time.