express nodejs Failed to lookup view error in views directory (How to Fix)

The article directories
Article Reference Express configuration interface template Failed to Lookup View “error” in Views Directory solution

This article refer to

    [] (Failed to lookup the view “error” in views directory solution)
    Express configuration interface template

    // view engine setup
    app.set('views', path.join(__dirname, 'views'));   //设置模板文件夹的路径
    app.set('view engine', 'html');   //设置视图模板为ejs

    Failed to Lookup View “error” in Views Directory solution
    When the template is loaded, there must be an error in the views folder. However, we formulated the ejs template in HTML format , so we could not find the error.html and reported an error when the project was loaded. Therefore, a new error.html was created under the Views folder, which successfully solved the problem

Read More: