简体   繁体   English

重新安装Windows后无法查看视图“错误”?

[英]Failed to lookup view “error” after reinstalling windows?

Everything in my Node project worked perfectly, but then I decided to reinstall my Windows OS so I copyied all my project to Google drive. Node项目中的所有内容都能正常运行,但是后来我决定重新安装Windows操作系统,因此将所有项目都复制到了Google驱动器中。 After i reinstalled, i went and downloaded my node project back to my desktop, installed node, and now i get this error: Failed to lookup view "error" in views directory "C:\\Users\\Tom\\Desktop\\Node\\views".....Why is this happening? 重新安装后,我去了并将节点项目下载回桌面,安装了节点,现在出现此错误:无法在视图目录“ C:\\ Users \\ Tom \\ Desktop \\ Node \\ views”中查找视图“错误” .....为什么会这样?

I have already searched for multiple solutions, but all of them say that this part of the code is to blame: 我已经搜索了多种解决方案,但是所有人都说,这部分代码应归咎于:

app.use(express.static(path.join(__dirname,'../public')));

I found the error. 我发现了错误。 After reinstalling windows and sublime, when I inserted my project, the files got renamed from index.ejs to index.ejs.html.... after getting rid of the ".html", everything worked perfectly. 重新安装Windows和Sublime之后,当我插入项目时,将文件从index.ejs重命名为index.ejs.html ....摆脱了“ .html”之后,一切运行正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM