Node.js、Hapi.js、EJS:reply.view文件:mac上的ok;“未找到”;在Ubuntu上

Node.js、Hapi.js、EJS:reply.view文件:mac上的ok;“未找到”;在Ubuntu上,node.js,macos,ubuntu,ejs,hapijs,Node.js,Macos,Ubuntu,Ejs,Hapijs,我正在将node.js服务器从运行Mac的笔记本电脑上的开发转移到运行Ubuntu 12.04的托管服务器上的生产 通过测试确保一切正常,我在Ubuntu控制台中发现以下错误: Debug: hapi, internal, implementation, error Error: View file not found: /var/local/app/pages/templates/appLogin.html 如果在控制台中键入cd/var/local/app/pages/templates

我正在将node.js服务器从运行Mac的笔记本电脑上的开发转移到运行Ubuntu 12.04的托管服务器上的生产

通过测试确保一切正常,我在Ubuntu控制台中发现以下错误:

Debug: hapi, internal, implementation, error 
Error: View file not found: /var/local/app/pages/templates/appLogin.html
如果在控制台中键入
cd/var/local/app/pages/templates/
,然后键入
ls
,则会显示
appLogin.html

在我的mac电脑上,一切正常

这是我如何使用Hapi.js设置EJS的:

var Ejs = require('ejs');
Ejs.registerHelper = function (name, fn) {
    engine.module.filters[name] = fn;
};
var serverOptions= {
cors: true,
files: { relativeTo: __dirname },
views: {
    engines: {
        html: {module: Ejs} },
        path: __dirname + '/pages/templates'
    }
};
var server = Hapi.createServer('localhost', '8000', serverOptions );

为什么不同?我缺少什么?

您应该在视图选项中添加
allowAbsolutionPath:true