Node Server Not Running: Exiting Without Any Output

Node Server Not Running: Exiting Without Any Output

I've been messing around with codesphere lately and have a weird issue, at least to me: my server.js:

const express =require('express');
const app = express();
const port = 8000;

app.get('/', (req,res) => {
  res.send('Hi there')
});

app.listen(port, () => {
  console.log("Running")
});

Upon npm start :

user@codesphere:app [master] $ npm start

[email protected] start /home/user/app
node server.js

then the output exits the server and returns to CLI

Output for running node server.js:

Another edit: upper part, my package.json in their ide, lower part: package.json open in terminal (nano) Now I actually think, it is save to assume they have trouble!

6
Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.