从命令提示符运行时,jasmine-node显示错误 [英] jasmine-node shows error when ran from command prompt
问题描述
使用以下方法安装jasmine-node:
Installed jasmine-node using this:
sudo npm install jasmine-node -g
成功并显示:
/usr/bin/jasmine-node -> /usr/lib/node_modules/jasmine-node/bin/jasmine-node
jasmine-node@1.14.3 /usr/lib/node_modules/jasmine-node
├── underscore@1.6.0
├── mkdirp@0.3.5
├── walkdir@0.0.7
├── jasmine-reporters@2.0.0
├── coffee-script@1.7.1
├── requirejs@2.1.14
├── jasmine-growl-reporter@0.0.3 (growl@1.7.0)
└── gaze@0.3.4 (minimatch@0.2.14, fileset@0.1.5)
但是当我尝试运行时: $ jasmine-node spec /
或 jasmine-node
它显示如下错误:
But when I try to run this: $ jasmine-node spec/
or jasmine-node
it shows the error like this:
/usr/lib/node_modules/jasmine-node/lib/jasmine-node/reporter.js:336
jasmineNode.TeamcityReporter.prototype = new jasmine.TeamcityReporter;
^
TypeError: undefined is not a function
at /usr/lib/node_modules/jasmine-node/lib/jasmine-node/reporter.js:336:44
at Object.<anonymous> (/usr/lib/node_modules/jasmine-node/lib/jasmine-node/reporter.js:342:3)
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)
at require (module.js:380:17)
at Object.<anonymous> (/usr/lib/node_modules/jasmine-node/lib/jasmine-node/index.js:34:21)
at Module._compile (module.js:456:26)
推荐答案
该问题与上一版 jasmine-reporter <有关/ code>模块,
jasmine-node
依赖于该模块。在修复问题之前你可以做的一个可能的解决方法是降级 jasmine-node
的版本,它取决于以前版本的 jasmine-reporter
。
The issue is relevant to last version of jasmine-reporters
module, on which jasmine-node
depends on. One of possible workarounds you can do until issue will be fixed is to downgrade version of jasmine-node
in which it depends on previous version of jasmine-reporters
.
sudo npm install jasmine-node@1.14.2 -g
当前版本是 1.14.3
,因此它落后于一个版本。
Current version is 1.14.3
, so it is one version behind.
此问题有一个漏洞:
https://github.com/larrymyers/jasmine-reporters/issues/63
这篇关于从命令提示符运行时,jasmine-node显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!