In your server.js,
keep only one
const expressLayouts = require("express-ejs-layouts")
/* ***********************
* View Engine and Templates
*************************/
app.set("view engine", "ejs")
app.use(expressLayouts) // => use the single import
app.set("layout", "layouts/layout") // => remove the ./ prefix