pact-js-core: Mock Server not Starting
I’m currently trying to set up pact with an Angular application and Karma. When running the karma test in which the pact is generated, I always get the error “process not found”:
Error: Command failed: taskkill /f /t /pid 13344
FEHLER: Der Prozess "13344" wurde nicht gefunden.
at checkExecSyncError (child_process.js:472:13)
at Object.execSync (child_process.js:512:13)
at Server.stop (C:\daten\workspaces\pact-node-test\node_modules\@pact-foundation\pact-node\src\server.js:138:7)
at Server.<anonymous> (C:\daten\workspaces\pact-node-test\node_modules\@pact-foundation\pact-node\src\server.js:117:8)
at ChildProcess.g (events.js:292:16)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:920:16)
at Socket.<anonymous> (internal/child_process.js:351:11)
at emitOne (events.js:96:13)
After some digging, I realized this is just a subsequent error to the mock server not starting. With LOGLEVEL set to DEBUG, I get the following log output before the above:
[2017-10-07T14:40:44.300Z] DEBUG: pact-node@4.12.0/14532 on THEMACHINE:
: cannot load such file -- bundler/vendor/molinillo/lib/molinillo/modules/specification_provider (LoadError)
So, there are two issues here:
- When the mock server isn’t starting, an error should be raised so that it’s clear what went wrong. That would have saved me some trouble finding the real cause, because I was first looking into the “process not found” error 😃.
- Why do I get the LoadError? Obviously is has something to do with Ruby dependencies not being satisfied, but I’m not (yet) into Ruby enough to find out what’s wrong here.
I have prepared a minimal example at https://github.com/thombergs/pact-node-test. Running npm run start I get the above error.
I would appreciate any hints on this issue 😉
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 23 (19 by maintainers)
I got it to work with the new version, and even through karma-pact now. Thanks a lot for your efforts.
@mefellows I’ve found several things wrong with pact-standalone. I think a lot of these bugs seems to have been when I updated pact-node to 5.1.0. I’m fixing them right now, should be out shortly.
@mefellows Can you make sure that the standalone is working correctly? I’m annoyed with npm optional dependency BS that they’re pulling. I think I’ll try packaging all binaries together without restrictions and let node figure it out at runtime which one to use.