首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我不能让莱卡和bdd一起工作

我不能让莱卡和bdd一起工作
EN

Stack Overflow用户
提问于 2013-08-12 03:01:38
回答 1查看 382关注 0票数 0

我用的是流星0.6.4.1,莱卡0.2.24和node.js 0.10.12。tdd测试运行良好,但我尝试在laika中使用bdd,但失败了。我下载了这个演示项目https://github.com/zvictor/laika-extended-example,但也失败了。我做了一个简单的测试摩卡和应该(只有node.js,而不是流星)和工作良好。这是我在演示项目中遇到的错误:

代码语言:javascript
复制
module.js:340
    throw err;
          ^
Error: Cannot find module 'should'
    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 Object.<anonymous> (/Users/camilo/Documents/Pruebas/Meteor/laika-extended-example/tests/$setup.js:1:72)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

编辑

我在should中安装了sudo npm install -g should

编辑2

基于skishore的评论,我使用了npm link should,现在问题变了。首先,我得到了:

代码语言:javascript
复制
injecting laika...
loading phantomjs...
loading initial app pool...

没有发生更多的事情,所以我尝试使用laika -D来查看日志:

代码语言:javascript
复制
[laika log] accepting the following extensions: (js)

  injecting laika...
  loading phantomjs...
[app touch log] [[[[[ ~/Documents/Pruebas/Meteor/laika-extended-example ]]]]]

[app touch log] => Meteor server running on: http://localhost:20472/
  loading initial app pool...
[laika log] using nodejs bin(from meteor): /Users/camilo/.meteor/tools/11f45b3996/bin/node
[server log]
[server log] /Users/camilo/Documents/Pruebas/Meteor/laika-extended-example/.meteor/local/build/server/server.js:325
  }).run();
     ^
[server log] ReferenceError: module is not defined
    at app/node_modules/should/lib/eql.js:5:1
    at /Users/camilo/Documents/Pruebas/Meteor/laika-extended-example/.meteor/local/build/server/server.js:286:12
    at Array.forEach (native)
    at Function._.each._.forEach (/Users/camilo/.meteor/tools/11f45b3996/lib/node_modules/underscore/underscore.js:79:11)
    at run (/Users/camilo/Documents/Pruebas/Meteor/laika-extended-example/.meteor/local/build/server/server.js:227:7)
EN

回答 1

Stack Overflow用户

发布于 2013-08-12 03:10:02

您需要安装应该。使用国家预防机制:

代码语言:javascript
复制
 sudo npm install -g should
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18178997

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档