Skip to content
This error keeps happening, ive tried tons of ports that should work, anybody that can help me?
Profile icon

throw er; // Unhandled 'error' event

Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (net.js:1316:16)
at listenInCluster (net.js:1364:12)
at Server.listen (net.js:1450:7)
at /home/runner/Node-stuff-test/index.js:18:8
at Script.runInContext (vm.js:130:18)
at Object. (/run_dir/interp.js:209:20)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1343:8)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'EADDRINUSE',
syscall: 'listen',
address: '::',
port: 3000

You are viewing a single comment. View All
Profile icon

use express

const fs = require('fs'); // File System (To read files) const express = require('express'); // Express (Server module) var app = express(); // App (Server) app.get('/', (req, res) => { // When someone goes to (The / means when someone requests /. If someone requests /projects, then you would want to do the same thing, but instead use /projects and projects.html) res.set('Content-Type', 'text/html'); // Set the MIME type ( res.send(fs.readFileSync('index.html', 'utf8')); // Read the contents of index.html and send it }); app.listen(8080, () => { // Listen on port 8080 (Dunno why, but for some reason I always use it) console.log('Server up and running!'); // You should see this if it works });
Profile icon

i got something working with just http [email protected]

Profile icon
Profile icon

why where u not on yesterday