Im对节点j新增。我使用化合物Js来创建crud操作。错误:无法找到模块'jade〜'
该应用程序是工作的罚款,直到我试图提醒值,在此之后,我发现了错误
500 Error: Cannot find module 'jade~'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
如何解决这个
我的指数
#tabs
ul
li
a(href='#tabs-1') New Leave
li
a(href='#tabs-2') Index of Leave
#tabs-1
.page-header
h1 New employee
- var form = formFor(employee, {action: pathTo.employees(), method: 'POST', id: "employee_form", class: 'form-horizontal'})
!= form.begin()
!= errorMessagesFor(employee)
.control-group
!= form.label("code", false, {class: "control-label"})
.controls
!= form.input("code")
.control-group
!= form.label("description", false, {class: "control-label"})
.controls
!= form.input("description")
.control-group
!= form.label("applicable", false, {class: "control-label"})
.controls
!= form.input("applicable")
.control-group
!= form.label("cForward", false, {class: "control-label"})
.controls
!= form.checkbox("cForward")
.control-group
!= form.label("limit", false, {class: "control-label"})
.controls
!= form.checkbox("limit")
.control-group
!= form.label("lop", false, {class: "control-label"})
.controls
!= form.checkbox("lop")
.control-group
!= form.label("od", false, {class: "control-label"})
.controls
!= form.checkbox("od")
.control-group
!= form.label("co", false, {class: "control-label"})
.controls
!= form.checkbox("co")
.control-group
!= form.label("lrevision", false, {class: "control-label"})
.controls
!= form.checkbox("lrevision")
.control-group
!= form.label("active", false, {class: "control-label"})
.controls
!= form.checkbox("active")
.form-actions
!= form.submit('<i class="icon-ok icon-white"></i> Create employee', {class: 'btn btn-primary'})
span= ' or '
!= linkTo('Cancel', pathTo.employees(), {class: 'btn'})
!= form.end()
#tabs-2
.page-header
h1 Index of employees
.row
.span12
p
!= linkTo('<i class="icon-plus icon-white"></i> New employee', path_to.new_employee(), {class: 'btn btn-primary'})
- if (employees.length) {
.row
.span12
table.table.table-striped
thead
tr
th ID
th.span3 Actions
tbody
- employees.forEach(function (employee) {
tr
td
!= linkTo('employee #' + employee.id, path_to.employee(employee))
td
!= linkTo('<i class="icon-edit"></i> Edit', pathTo.edit_employee(employee), {class: 'btn btn-mini'}) + ' '
!= linkTo('<i class="icon-remove icon-white"></i> Delete', pathTo.employee(employee), {class: 'btn btn-mini btn-danger', method: 'delete', remote: true, jsonp: '(function (u) {location.href = u;})'})
- });
- } else{
.row
.span12
p.alert.alert-block.alert-info
strong No employees were found.
- }
布局文件
!!! 5
html
head
title= title
!= stylesheetLinkTag('http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/themes/base/jquery-ui.css', 'bootstrap', 'application', 'bootstrap-responsive')
!= javascriptIncludeTag('https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.js', 'rails', 'application')
script
$(document).ready(function() {
$("#tabs").tabs();
});
!= csrfMetaTag()
body
.navbar
.navbar-inner
.container
a.brand(href='#') Project name
.container
- var flash = request.flash('info').pop(); if (flash) {
.alert.alert-info= flash
- }
- flash = request.flash('error').pop(); if (flash) {
.alert.alert-error= flash
- }
!= body
hr
footer
p © Company 2012
!= contentFor('javascripts')
要检查哪个文件? – Okky 2013-03-08 08:27:07
该应用程序工作正常,直到我添加了一个提醒。 – Okky 2013-03-08 08:28:13
您可能已将您的文件命名为'server.js'或'app.js'。有限的证据强烈地指向一个非常简单的基本错字。搜索你的文件“玉〜”并修复它,然后继续你的生活。你认为它工作正常,直到你添加了警报,但你肯定是误导了。 node.js中没有警报,浏览器中发生的事情不会导致节点找不到玉石模块。 – 2013-03-08 08:34:29