Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Couchdb 意外标记“;缩进;运行时出错_Couchdb_Pug_Node Modules_Unexpected Token - Fatal编程技术网

Couchdb 意外标记“;缩进;运行时出错

Couchdb 意外标记“;缩进;运行时出错,couchdb,pug,node-modules,unexpected-token,Couchdb,Pug,Node Modules,Unexpected Token,布局。jade doctype html head title=title link(rel='stylesheet',href='/stylesheet/style.css') body block content extend layout block content h1 Add new contact form(method="POST", action='/new_contact')

布局。jade

doctype
html
    head
      title=title
      link(rel='stylesheet',href='/stylesheet/style.css')
    body
      block content 
extend layout   

  block content 
      h1 Add new contact
      form(method="POST", action='/new_contact')
      p Name:
      input#title(type="text ",name=name)
      p Phone:
      input#title(type="text",name=phone)

      p: button(type="submit") Add new Contact
      h1 Add new database
      form(method="POST", action='/createdb')
      p Database name:
      input#title(type="text",name=dbname)
      p: button(type="submit") Add new Database

      h1 Delete the Contact
      form(method="POST", action='/delete_contact')
      p Phone:
      input#title(type="text",name=phone)
      p: button(type="submit") Delete Contact

      h1 View the Contact
      form(method="POST", action='/view_contact')
      p Phone:
      input#title(type="text",name=phone)
      p: button(type="submit") View the  Contact
index.jade

doctype
html
    head
      title=title
      link(rel='stylesheet',href='/stylesheet/style.css')
    body
      block content 
extend layout   

  block content 
      h1 Add new contact
      form(method="POST", action='/new_contact')
      p Name:
      input#title(type="text ",name=name)
      p Phone:
      input#title(type="text",name=phone)

      p: button(type="submit") Add new Contact
      h1 Add new database
      form(method="POST", action='/createdb')
      p Database name:
      input#title(type="text",name=dbname)
      p: button(type="submit") Add new Database

      h1 Delete the Contact
      form(method="POST", action='/delete_contact')
      p Phone:
      input#title(type="text",name=phone)
      p: button(type="submit") Delete Contact

      h1 View the Contact
      form(method="POST", action='/view_contact')
      p Phone:
      input#title(type="text",name=phone)
      p: button(type="submit") View the  Contact
我在运行应用程序时不断遇到此错误

Error: C:\Users\Priyanka-PC\Desktop\Node\NodeApp\views\index.jade:3
    1|       extend layout
    2|       
  > 3|         block content 
    4|             h1 Add new contact
    5|             form(method="POST", action='/new_contact')
    6|             p Name:

unexpected token "indent"
    at Parser.parseExpr (C:\Users\Priyanka-PC\Desktop\Node\NodeApp\node_modules\jade\lib\parser.js:254:15)
    at Parser.parse (C:\Users\Priyanka-PC\Desktop\Node\NodeApp\node_modules\jade\lib\parser.js:122:25)
    at parse (C:\Users\Priyanka-PC\Desktop\Node\NodeApp\node_modules\jade\lib\index.js:104:21)
    at Object.exports.compile (C:\Users\Priyanka-PC\Desktop\Node\NodeApp\node_modules\jade\lib\index.js:205:16)
    at handleTemplateCache (C:\Users\Priyanka-PC\Desktop\Node\NodeApp\node_modules\jade\lib\index.js:174:25)
    at Object.exports.renderFile (C:\Users\Priyanka-PC\Desktop\Node\NodeApp\node_modules\jade\lib\index.js:380:10)
    at Object.exports.renderFile (C:\Users\Priyanka-PC\Desktop\Node\NodeApp\node_modules\jade\lib\index.js:370:21)
    at View.exports.__express [as engine] (C:\Users\Priyanka-PC\Desktop\Node\NodeApp\node_modules\jade\lib\index.js:417:11)
    at View.render (C:\Users\Priyanka-PC\Desktop\Node\NodeApp\node_modules\express\lib\view.js:135:8)
    at tryRender (C:\Users\Priyanka-PC\Desktop\Node\NodeApp\node_modules\express\lib\application.js:640:10)
请帮助。

两个问题:

  • 它是
    extend
    而不是
    extend

  • 您的块需要与extends处于同一“级别”

  • 这将有助于:

    extends layout   
    
    block content
      h2 blah blah blah
    

    有关更多详细信息和一些示例,请阅读《关于帕格中的继承》一书。

    您能否再次尝试格式化问题中的代码?以下是有关标记格式的指南: