我有以下錯誤。我不知道如何解決它。我是處理哈巴狗檔案的新手。它顯示以下錯誤:
Error: /home/nobin/jadeApp/views/show_message.pug:9:33
7| else
8| h3 New person,
> 9| name: #{person.name},
---------------------------------------^
10| age: #{person.age} and
11| nationality: #{person.nationality} added!
unexpected text ",
"
at makeError (/home/nobin/jadeApp/node_modules/pug-error/index.js:34:13)
at Lexer.error (/home/nobin/jadeApp/node_modules/pug-lexer/index.js:62:15)
at Lexer.fail (/home/nobin/jadeApp/node_modules/pug-lexer/index.js:1629:10)
at Lexer.advance (/home/nobin/jadeApp/node_modules/pug-lexer/index.js:1694:12)
at Lexer.callLexerFunction (/home/nobin/jadeApp/node_modules/pug-lexer/index.js:1647:23)
at Lexer.getTokens (/home/nobin/jadeApp/node_modules/pug-lexer/index.js:1706:12)
at lex (/home/nobin/jadeApp/node_modules/pug-lexer/index.js:12:42)
at Object.lex (/home/nobin/jadeApp/node_modules/pug/lib/index.js:104:9)
at Function.loadString [as string] (/home/nobin/jadeApp/node_modules/pug-load/index.js:53:24)
at compileBody (/home/nobin/jadeApp/node_modules/pug/lib/index.js:82:18)
我的 show_message.pug 檔案:
html
head
title Person
body
if(type == "error")
h3(style = "color:red") #{message}
else
h3 New person,
name: #{person.name},
age: #{person.age} and
nationality: #{person.nationality} added!
uj5u.com熱心網友回復:
好吧,我都不精通,但是根據您的錯誤,您可能想嘗試在末尾洗掉逗號
.
.
name: #{person.name},
到
.
.
name: #{person.name}
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/440860.html
標籤:javascript 节点.js 表示 哈巴狗 玉4j
