【问题标题】:Jade: Unexpected Identifier error on Ubuntu Machine - works on MacJade:Ubuntu 机器上出现意外的标识符错误 - 适用于 Mac
【发布时间】:2014-10-05 19:10:36
【问题描述】:

我遇到的问题是这在我的 Mac 机器上运行良好,但是在将其迁移到 Ubuntu 时出现此错误。

这是我的 index.jade 部分

.container-fluid
.row
    .jumbotron
        center
            h2 {{message}}

.container
    center 
       h2 Line Items
       table
        tr
            th File Name
            th File Type
            th ID
        tr
        tr(ng-repeat="infos in info")
            td {{infos.filename}}
            td {{infos.type}}
            td {{infos.id}}


.container
    form(name="metadata" ng-class="{ 'has-error': userForm.email.$invalid }")
        div.row
            div.col-md-4(style="background-color:#eee;height:200px")
                center
                    h1 Resource Type
                    h3 Enter the type of file you are trying to upload
                    strong Sound Recording / Image
                div
                    center
                        select(name="type" ng-model="file.type") 
                            option Sound Recording
                            option Image
            div.col-md-4(style="background-color:#eee;height:200px")
                center
                h1 File Name
                h3 Enter the name of the file
                input(name="filename" ng-model="file.name" placeholder="filename.wav / image.jpg")
            div.col-md-4(style="background-color:#eee;height:200px")
                center
                    h1 ISRC
                    h3 Enter the ISRC Number
                    input(name="isrc" ng-model="file.isrc" placeholder="Your ID")
            button.btn.btn-primary(ng-click="save(file)") Submit

这给了我错误:

Error: /home/me/dashboards/angular-express-seed/views/partials/index.jade:48
46|                 
47|         

48|

第 141 行:意外的标识符

我在那一行没有任何内容,因此文档的其他地方可能有问题。

另外 - 运行 jade ./views/partials/index.jade 返回 rendered index.html

任何帮助将不胜感激。

【问题讨论】:

    标签: node.js angularjs macos ubuntu pug


    【解决方案1】:

    这是语法的问题

    form(name="metadata" ng-class="{ 'has-error': userForm.email.$invalid }")
    

    它应该像下面的逗号

    form(name="metadata", ng-class="{ 'has-error': userForm.email.$invalid }")
    

    适用于所有带有属性的标签。不确定它在 Mac 上是如何工作的,因为它应该给出相同的错误。

    【讨论】:

    • 伙计,谢谢 - 这完全适用于我的 Mac 和我拥有的另一个较旧的 Ubuntu 实例。再次感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-28
    • 1970-01-01
    • 2017-09-03
    • 1970-01-01
    • 2014-07-25
    相关资源
    最近更新 更多