Mayukh Roy
Mayukh Roy

Reputation: 1815

jasmine-node shows error when ran from command prompt

Installed jasmine-node using this:

sudo npm install jasmine-node -g

It is successful and shows:

/usr/bin/jasmine-node -> /usr/lib/node_modules/jasmine-node/bin/jasmine-node
[email protected] /usr/lib/node_modules/jasmine-node
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected])

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)

Upvotes: 3

Views: 2100

Answers (1)

Vadim
Vadim

Reputation: 8779

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 [email protected] -g

Current version is 1.14.3, so it is one version behind.

There is an open bug for this issue: https://github.com/larrymyers/jasmine-reporters/issues/63

Upvotes: 13

Related Questions