To fix Error: Failed to lookup view in Node Express, we should use a valid path.
For instance, we write
const path = require("path");
app.use(express.static(path.join(__dirname + "../public")));
to call express.static
foplder with the path returned by path.join
to get the path of the /public folder one level above __dirname
to expose the folder as the static files folder.