gpt4 book ai didi

node.js - 语法错误: Unexpected Indentifier while compiling ejs problem

转载 作者:行者123 更新时间:2023-12-03 00:34:29 24 4
gpt4 key购买 nike

我在 Windows 中运行应用程序时遇到以下错误。

    SyntaxError: Unexpected identifier in \path\views\landing.ejs while compiling ejs
If the above error is not helpful, you may want to try EJS-Lint:
https://github.com/RyanZim/EJS-Lint
Or, if you meant to create an async function, pass `async: true` as an option.
at new Function (<anonymous>)
at Template.compile (\path\node_modules\ejs\lib\ejs.js:626:12)
at Object.compile (\path\node_modules\ejs\lib\ejs.js:366:16)
at handleCache (\path\node_modules\ejs\lib\ejs.js:215:18)
at tryHandleCache (\path\node_modules\ejs\lib\ejs.js:254:16)
at View.exports.renderFile [as engine] (\path\node_modules\ejs\lib\ejs.js:459:10)
at View.render (\path\node_modules\express\lib\view.js:135:8)
at tryRender (\path\node_modules\express\lib\application.js:640:10)
at Function.render (\path\node_modules\express\lib\application.js:592:3)
at ServerResponse.render (\path\node_modules\express\lib\response.js:1012:7)

这是我的代码片段:

<% include partials/header %>
<h1>Landing Page</h1>
<a href ="/campgrounds">View all campgrounds</a>
<p>Trademark</p>
<% include partials/footer %>

最佳答案

<%- include('header'); -%>
<h1>
Title
</h1>
<p>
My page
</p>
<%- include('footer'); -%>

关于node.js - 语法错误: Unexpected Indentifier while compiling ejs problem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59106739/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com