始终出错 - "path" 参数必须是字符串、缓冲区或 URL 类型之一。接收类型未定义

Always errors - The "path" argument must be one of type string, Buffer, or URL. Received type undefined

我对我的应用程序进行了一系列更改,我认为这些更改与小胡子无关,突然我尝试呈现的每个页面都会出现此错误。

The "path" argument must be one of type string, Buffer, or URL. Received type undefined
at Object.readFile (fs.js:297:3)
at read (/home/malcolm/complice/node_modules/hogan-express/hogan-express.js:32:14)
at renderPartials (/home/malcolm/complice/node_modules/hogan-express/hogan-express.js:58:7)

啊哈,原来我还在尝试包括一个旧的 partial。所以我的代码看起来像下面这样。当我删除 oldpage.mustache 时它坏了,当我从下面删除 oldpage 行时它再次工作正常。

var partials = {
  'login_form': 'login_form',
  'analytics': 'analytics',
  'oldpage': 'oldpage',
}
app.set('partials', partials)   // define partials available to all pages