4-3章节7分钟时候,启动项目报ejs错误
来源:
yql
2016-06-17
老师,按照你的视频敲代码,4-3章节中启动项目时候,tpl.js中的var compiled = ejs.compile(tpl);报错,错误信息为:
D:\it\study\nodejs\wechat\node_modules\ejs\lib\ejs.js:474
throw e;
^
SyntaxError: Unexpected token else while compiling ejs
at Function (native)
at Object.Template.compile (D:\it\study\nodejs\wechat\node_modules\ejs\lib\ejs.js:464:12)
at Object.compile (D:\it\study\nodejs\wechat\node_modules\ejs\lib\ejs.js:288:16)
at Object.<anonymous> (D:\it\study\nodejs\wechat\tpl.js:55:20)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (D:\it\study\nodejs\wechat\util.js:6:11)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
1回答
-
yql
提问者
2016-06-17
自己在模板里面的内容少了}导致编译出错,问题解决了
00
相似问题