错误:找不到模块'jade~'
Error: Cannot find module 'jade~'
我是node js的新手。我使用Compound Js创建了一个crud操作。
应用程序工作正常,直到我试图提醒一个值,之后我得到错误
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')
我在nodeschool expressworks教程中遇到了同样的问题。我通过在package.json中包含依赖项来解决这个问题:
npm install --save express jade
我有完全相同的问题,但"找不到模块'jade'",而不是'jade~';我很确定我已经执行了"npm install jade"。经过一段时间的研究,我发现我的问题是因为我在全球安装express而jade是在本地安装的,参考这个帮助https://www.openshift.com/forums/express/nodejs-and-jade-error-cannot-find-module-jade我解决了我的问题。我把它贴在这里是想帮助那些和我有同样问题的人:)
对我来说,这是一个不同的问题。我在本地和全球都安装了玉和表达,希望他们能找到彼此,但还是表达了对玉的抱怨。
我的错误看起来像这样:
Express server listening on port 3000
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:364:17)
at require (module.js:380:17)
at new View (/Users/ajeetganga/node_modules/express/lib/view.js:43:49)
at Function.app.render (/Users/ajeetganga/node_modules/express/lib/application.js:488:12)
at ServerResponse.res.render (/Users/ajeetganga/node_modules/express/lib/response.js:798:7)
at exports.index (/Users/ajeetganga/Documents/WORKSPACE/TinyUrl/MyTinyUrl2/routes/index.js:7:7)
at callbacks (/Users/ajeetganga/node_modules/express/lib/router/index.js:164:37)
at param (/Users/ajeetganga/node_modules/express/lib/router/index.js:138:11)
at new View (/Users/ajeetganga/node_modules/express/lib/view.js:43:49)
你会看到它不是全局或本地npm安装的默认位置。因此,作为一种解决方案,我将jade安装在以下文件夹
中cd /Users/ajeetganga/node_modules/
npm install jade
我想即使我从/Users/ajeetganga/文件夹中安装jade,但我从来没有尝试过。:)
我正在研究的The issue was with Fedora-16
。在编辑ie时创建的临时文件。"指数。
这个问题可以在Fedora-16中通过删除临时文件索引来解决。jade~'或通过将节点模块'jade'重命名为'jade~'
嗯,你几乎肯定有一个简单的拼写错误的require('jade~')
,你想要的只是require('jade')
。检查您的快速app.engine('jade')
线作为另一个可能的嫌疑人。
我在用Emacs编辑jade文件后遇到了同样的问题。解决方法很简单:找到jade~文件并删除它。
我也有同样的问题(我的typescript + webpack项目中的jade-loader)。我通过安装jade-loader作为peer-dependency来解决这个问题。
- 气质的“nestRemoting()”有时可以'找不到关系
- 错误405:向Java控制器(Ajax)发送JSON时找不到POST方法
- 找不到模块捆绑包
- for循环中的javascript if语句找不到==
- 为什么JavaScript可以'找不到给定的InnerHTML并返回Cannot set property
- 失败:等待Protractor与页面同步时出错:“”;在窗口上找不到角度”;
- Babel编译错误:找不到模块核心js/library/fn/get迭代器
- [Vue warn]:找不到元素
- ngRoute找不到模板
- 未能加载,因为找不到支持的源.当播放HTML5音频元素时
- 因果报应-找不到模块:错误:无法解析模块'scs'
- Angular 2:在本地.json文件上找不到文件
- module.js在运行iron节点时找不到模块
- 放大弹出生成“;找不到文件”;YouTube视频的错误
- 我发现了一些只在移动设备上可见的垃圾邮件链接,我可以'找不到包含此垃圾邮件链接的脚本的位置
- Web 地址虚拟目录会断开外部 JavaScript 链接,因此找不到文件
- Meteor.js可以'找不到语义:ui包
- 找不到容器:goog.Disposable.instances _在为javascript工具使用泄漏查找器时出错
- 为什么找不到模块'jade'
- 错误:找不到模块'jade~'