Failed to lookup view "error" in views directory 解决方案

新建了一个nodejs项目,默认是jade模板。改成ejs模板,使用html作为启动项。此时运行程序报错了:Failed to lookup view "error" in views directory

app.js:

以下是报错:

查了一圈,发现是模板在加载的时候,views文件夹里必须有一个error,而我们制定ejs模板为html格式,所以在项目加载的时候找不到error.html而报错

所以在views文件夹下新建一个error.html,成功解决了此问题

时间: 2024-11-09 10:23:10

Failed to lookup view "error" in views directory 解决方案的相关文章

Failed to lookup view... in views directory...

从网络上查找来看,在调试NODE.JS+EXPRESS程序时,对于新手而言,难免会出现如题所示的错误. 对于我,具体情况是:在本地运行OK(我使用了LEANCLOUD):但是,等部署到LEANCLOUD云端再运行系统时却出现错误,如下: Error: Failed to lookup view "......" in views directory "..." 初步看起来是系统在指定视图路由位置找不到视图部分,感觉很是奇怪!本地运行正常呀! 通过翻墙头(其实不翻也可

kvm打开虚拟机失败Failed to bindsocket: No such file or directory

kvm打开虚拟机失败Failed to bindsocket: No such file or directory 使用virt-manger克隆一个虚拟机,再打开虚拟机失败,失败错误如下: Error starting domain: internal error:process exited while connecting to monitor: 2016-09-23T11:25:02.302266Zqemu-kvm: -chardevsocket,id=charchannel0,path

ASP.NET MVC页面报错System.InvalidOperationException The view found at '~/Views/Home/Index.cshtml' was not created.

Application Exception System.InvalidOperationException The view found at '~/Views/Home/Index.cshtml' was not created. Description: HTTP 500.Error processing request. Details: Non-web exception. Exception origin (name of application or object): System

记处理线上记录垃圾日志 The view 'Error' or its master was not found

最近监控线上日志,网站是ASP.NET MVC 开发的,发现不少错误日志都记录同样的内容: The view 'Error' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/Search/Error.aspx ~/Views/Search/Error.ascx ~/Views/Shared/Er

iOS9 白名单问题 -canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"

[iOS开发]-canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx" Collection/Bookmark/Share for width under 768px 控制台输出 如图是在我启动一个 Xcode 7 + iOS 9 的 App 之后,控制台的输出. 这在 Xcode 6.4 + iOS 8 时,是不会有的情况,原因是[为了强制增

Failed to issue method call: Unit mysqld.service failed to load: No such file or directory.

可能的原因: 1.http://blog.sina.com.cn/s/blog_4692ea0a0101jqhz.html 2.http://diag.5ustore.com/proxy/index.php?url=1J1h12y31F1b1918yLyByU1FyNyjyD101z1612yo1C1cyc1sy3yc1yyN161611yY0RyiyiyJyY1hymylyj1hyL1gyS1LyWyR1Myhyk0VyMylyvyg0j1j1D1F1k18171r1P1HyuyI1DyNyB

VS 2017 Git failed with a fatal error的解决办法

前几天,满怀欣喜的从VS2015更新到了VS2017,经过这几天的试用,整体来说感觉还是挺不错的.昨天推送项目到远程服务器的时候,发现出现了推送失败的错误,错误如图: 按照提示,我看到输出窗口的输入内容如下: 当时以为更换了VS导致了ssh key丢失,重新输入密码验证一下就可以了,于是开始想办法找输入密码的地方. 经过一番折腾寻找,发现点击操作的时候,出现如下菜单: 这里我们选择"打开命令提示符"菜单,打开了命令提示符,输入提交到远程命令: git push origin maste

idea报错:error java compilation failed internal java compiler error

idea下面报如下问题 error java compilation failed internal java compiler error 解决办法:Setting->Compiler->Java Compiler,发现有的module是1.7的是1.6的,重新删除再导入好了

Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded??

如果你遇到了服务无法启动的情况,也不报错的,查看logs下的日志,首次安装报错如下:AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded??我想日志已经说的很清楚了,这里编译安装后,配置文件conf/httpd.conf没有开启mod_slotmem_shm模块,编辑该文件,放开LoadModule slotmem_shm_module modules/mod_slotmem_shm.s