巴哥犬中的“意外文本”错误是什么意思?

时间:2019-11-06 09:03:14

标签: node.js express pug

我正在尝试为我的Web应用程序运行index.pug文件,该文件是通过将pug与node.js-Express结合使用创建的,但是我一直遇到此错误:

    { Error: C:\Users\albin.ademin\node-wms\node-wms\views\index.pug:13:6
        11|                 script(src='/hc-offcanvas-nav/dist/hc-offcanvas-nav.js?ver=3.4.0')
        12|
      > 13|         body
    -------------^
        14|                 .wrapper
        15|                         form.form-signin
        16|                         h2.form-signin-heading Please login

    unexpected text "
                    "
        at makeError (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug-error\index.js:32:13)
        at Lexer.error (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug-lexer\index.js:58:15)
        at Lexer.fail (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug-lexer\index.js:1304:10)
        at Lexer.advance (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug-lexer\index.js:1364:15)
        at Lexer.callLexerFunction (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug-lexer\index.js:1319:23)
        at Lexer.getTokens (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug-lexer\index.js:1375:12)
        at lex (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug-lexer\index.js:12:42)
        at Object.lex (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug\lib\index.js:99:27)
        at Function.loadString [as string] (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug-load\index.js:44:24)
        at compileBody (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug\lib\index.js:86:18)
        at Object.exports.compile (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug\lib\index.js:243:16)
        at handleTemplateCache (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug\lib\index.js:216:25)
        at Object.exports.renderFile (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug\lib\index.js:418:10)
        at Object.exports.renderFile (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug\lib\index.js:408:21)
        at View.exports.__express [as engine] (C:\Users\albin.ademin\node-wms\node-wms\node_modules\pug\lib\index.js:455:11)
        at View.render (C:\Users\albin.ademin\node-wms\node-wms\node_modules\express\lib\view.js:135:8)
      code: 'PUG:UNEXPECTED_TEXT',
      msg: 'unexpected text "\t\t\n\t\t"',
      line: 13,
      column: 6,
      filename:
       'C:\\Users\\albin.ademin\\node-wms\\node-wms\\views\\index.pug',

这是我的index.pug文件:

    html
    head
        //stylesheet
        title login
        link(rel='stylesheet', href='/css/loginStyle.css')
        link(rel='stylesheet', href='/bower_components/bootstrap/dist/css/bootstrap.css')
        link(rel='stylesheet', href='/hc-offcanvas-nav/dist/hc-offcanvas-nav.css?ver=3.4.0')

        //scripts
        script(src='/hc-offcanvas-nav/dist/hc-offcanvas-nav.js?ver=3.4.0')

    body        
        .wrapper
            form.form-signin
                h2.form-signin-heading Please login
                input.form-control(type='text' name='username' placeholder='Email Address' required='')
                input.form-control(type='password' name='password' placeholder='Password' required='')
                label.checkbox
                    input#rememberMe(type='checkbox' value='remember-me' name='rememberMe')
                    |  Remember me
            button.btn.btn-lg.btn-primary.btn-block(type='submit') Login

我尝试了一些操作,例如检查选项卡或安装软件包,但此错误不会消失。

0 个答案:

没有答案