Answer the question
In order to leave comments, you need to log in
The project does not start with the node app.js command, how to fix it?
Hello. There is a simple server on express, apart from express, no packages are installed. node version: 16.14.0. express version: 4.17.2.
When you try to run through node app.js - nothing happens, the command hangs like this for a very long time or until you kill the ctrl+c process. BUT! If you run it through nodemon app.js (which I'm used to), everything works. I didn’t even notice, I wrote the project for 4 days, it came to deployment, and here it’s such a joke. I have no idea what to do if I output only console.log(1) in app.js - it starts.
If you run with express connected, even like this, it freezes:
app.js
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.sendFile('./auth.html');
});
app.listen(3000);
{
"dependencies": {
"express": "^4.17.2"
},
"name": "map",
"version": "1.0.0",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/"
},
"homepage": "https://github.com/",
"description": ""
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question