NodeJS - All Forum

server error

import app from "./app.js"; app.listen( PORT, ()=>{     console.log(`Server now listening on port ${PORT}`) } )Why isn't it working?

  • 1
  • 0
Conditional statement using switch operator

The switch operator method is another way of writing your conditional statements. It involves the use of Switch keyword and create case inside it to make your conditions work. Check the picture for more info on how to use your switch operator

  • 1
  • 0
Node js server error

  • 0
  • 0
Node ser error (NODEMON)

Emitted 'error' event on Server instance at:    at emitErrorNT (node:net:1924:8)    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {          code: 'EADDRINUSE',  errno: -4091,  syscall: 'listen',  address: '::1',  port: 5000}Node.js v20.12.2[nodemon] app crashed - waiting for file changes before...

  • 0
  • 0
Node server error

I'm getting this error on my node terminal Error: listen EADDRINUSE: address already in use :::5000    at Server.setupListenHandle [as _listen2] (node:net:1897:16)    at listenInCluster (node:net:1945:12)    at Server.listen (node:net:2037:7)    at Object.<anonymous> (C:\Users\KINGSPARK\Desktop\javascript\server.js:20:8)    at Module._co...

  • 0
  • 0
Error

$dsn = "mysql:host = localhost:dbname = myfirstdb"; $dbusername = "root"; $dbpassword = "root";try {    $pdo = new pdo($dsn, $dbusername, $dbpassword);    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e){    echo "Connection failed: " . $e->getMessage();}Connection failed: SQLSTATE[HY000] [2002] The requested add...

  • 0
  • 0
Error

[nodemon] clean exit - waiting for changes before restart[nodemon] restarting due to changes...[nodemon] starting `node server.js`Error: querySrv ETIMEOUT _mongodb._tcp.cluster0.xynaatn.mongodb.net&nbsp; &nbsp; at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:275:17) {&nbsp; errno: undefined,&nbsp; code: 'ETIMEOUT',&nbsp; syscall: 'querySrv&#...

  • 0
  • 0