首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SyntaxError:编译ejs时意外的token.ejs

SyntaxError:编译ejs时意外的token.ejs
EN

Stack Overflow用户
提问于 2019-11-29 11:07:34
回答 1查看 5.4K关注 0票数 1

我的ejs文件路径不工作。

C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\views\landing.ejs中的SyntaxError:编译ejs时意外的令牌'/‘ 如果上面的错误没有帮助,您可能希望尝试EJS:https://github.com/RyanZim/EJS-Lint,或者,如果要创建异步函数,可以将async: true作为选项传递。(C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:626:12) at Object.compile (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:366:16) at handleCache (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs. at Template.compile联合材料:215:18)在(C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:254:16) at View.exports.renderFile 作为发动机 at View.render (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\view.js:135:8) at tryRender (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\application.js:640:10) at Function.render (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\application.js:592:3) at ServerResponse.render (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\response.js:1012:7) at C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\(C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\route.js:137:13) at Layer.handle 请求 at Route.dispatch (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\route.js:112:3) at Layer.handle 请求 at C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\index.js:281:22

这是我的密码

这是我的文件夹结构

在这里输入图像描述在这里输入图像描述在这里输入图像描述

在这里输入图像描述有人能解决这个问题吗?

EN

回答 1

Stack Overflow用户

发布于 2019-12-10 17:30:38

landing.ejs代码中替换:

代码语言:javascript
复制
<%- include ./partials/header %>

在这方面:

代码语言:javascript
复制
<%- include ('./partials/header') %>

对页脚也做同样的事情。

票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59103634

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档