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:enter image description here

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!enter image description here

6 Related questions 3 node.js server not running 0 Node.js server not working 3 Node won't run, just exits code 0 Related questions 3 node.js server not running 0 Node.js server not working 3 Node won't run, just exits code 0 3 why node.js process is killed? 1 node - Nothing happens when running a script 2 node.js server won't start 1 Stuck at starting 'node server.js' .. won't get any output. What's the issue? 2 NodeJS exiting prematurely 0 Node Server not working in console Node Js 0 Node.js server just keeps loading with no result Load 7 more related questions Show fewer related questions Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like