Error: failed to locate view "layout"

为了定位错误,我将项目删减到最简,现在只留下index,在浏览器中报错为

Error: failed to locate view "layout"
    at Function.exports.compile (/home/pc/project/mongooseLearning/node_modules/express/lib/view.js:61:15)
    at ServerResponse.res._render (/home/pc/project/mongooseLearning/node_modules/express/lib/view.js:417:18)
    at ServerResponse.res.render (/home/pc/project/mongooseLearning/node_modules/express/lib/view.js:318:17)
    at ServerResponse.res._render (/home/pc/project/mongooseLearning/node_modules/express/lib/view.js:432:10)
    at ServerResponse.res.render (/home/pc/project/mongooseLearning/node_modules/express/lib/view.js:318:17)
    at /home/pc/project/mongooseLearning/app.js:47:7
    at callbacks (/home/pc/project/mongooseLearning/node_modules/express/lib/router/index.js:272:11)
    at param (/home/pc/project/mongooseLearning/node_modules/express/lib/router/index.js:246:11)
    at pass (/home/pc/project/mongooseLearning/node_modules/express/lib/router/index.js:253:5)
    at Router._dispatch (/home/pc/project/mongooseLearning/node_modules/express/lib/router/index.js:280:5)
    这是我项目的截图。我从始至终的文件里都没有写layout,但是它却要去找layout文件,让我很想不明白,这是为什么?

http://img.mukewang.com/567788c5000133d813660768.jpg

勇恒的思念
浏览 1477回答 1
1回答

qq_神话_6

你写html页面元素是完整的吗?会不会你没有写头元素之类的?
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Node.js