index.html should be opened via web server. simply opening the html won't work.
(the project is assumed to be in the 'public' folder)
var express = require('express');
const path = require('path');
var app = express();
app.use(express.static('public'));
app.get('/', function(req, res){
res.sendFile(path.join(__dirname, 'public/index.html'));
});
app.listen(2000);