Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pact-node fails to launch mock server on windows #90

Closed
bbarke opened this issue May 7, 2018 · 14 comments
Closed

pact-node fails to launch mock server on windows #90

bbarke opened this issue May 7, 2018 · 14 comments

Comments

@bbarke
Copy link
Contributor

bbarke commented May 7, 2018

We are using pact-node (v6.16.0) bundled with pact-karma (2.1.5) and pact-web (5.9.0)

When trying to run the pact tests on a windows machine, I'm seeing the following error

[2018-05-07T22:23:19.539Z]  INFO: pact-node@6.16.0/7872 on xxxxxx: Created 'standalone\win32-1.38.0\bin\pact-mock-service.bat service --port '3110' --consumer 'consumer' --prov
ider 'provider' --log 'C:\.....\pacts\stubserver-integration.log' --pact_dir '.....\pacts' --pact-file-writ
e-mode 'overwrite' --host 'localhost'' process with PID: 8688
[2018-05-07T22:23:24.034Z]  WARN: pact-node@6.16.0/7872 on xxxxxx: Pact exited with code 1.
[2018-05-07T22:23:24.036Z]  INFO: pact-node@6.16.0/7872 on xxxxxx: Removing Pact with PID: 8688
ERROR: The process "8688" not found.

When trying to run that bat file directly, I get the following error

C:\.....\node_modules\@pact-foundation\pact-node\standalone\win32-1.38.0\bin>pact-mock-service.bat
C:\.....\node_modules\@pact-foundation\pact-node\standalone\win32-1.38.0\lib\ruby\bin\..\bin.real\ruby.exe: No such file or directory -- UI (LoadError)

Any pointers on why this is happening?

@mefellows
Copy link
Member

Hmm could you please share your Windows environment details?

Which shell are you running it on?

@mboudreau
Copy link
Contributor

@bbarke was there any issues with your install process? There's a postinstall that runs and downloads the binary files needed for your OS. Maybe just try to reinstall it using npm uninstall @pact-foundation/pact-node; npm install @pact-foundation/pact-node.

@bbarke
Copy link
Contributor Author

bbarke commented May 8, 2018

This is on Windows 10 with the regular windows terminal.

It looks like the issue was because the location/path of the project had a space in it, for example:

C:\MY UI\angular-project\ it was failing because it didn't handle the space and tried to run 'UI' as an argument, resulting in 'no such file or directory -- UI'

@mboudreau
Copy link
Contributor

@bbarke wait, pact-node didn't work because of the space or just the .bat command? Because if it's the former, there's definitely an issue which shouldn't happen. Can you please confirm?

@bbarke bbarke changed the title pact-node fails to launch mock server on windows` pact-node fails to launch mock server on windows May 9, 2018
@bbarke
Copy link
Contributor Author

bbarke commented May 9, 2018

Yes I can confirm this. I renamed a working pact project path to have a space in it, and pact failed to launch. I changed the name back to to not have a space, and it started working again.

@mboudreau
Copy link
Contributor

@bbarke my question is, are you talking about using the command line to hit the .bat file, or using the pact-node CLI/API? Because if it's the latter, that's a bug that needs to be fixed.

@bbarke
Copy link
Contributor Author

bbarke commented May 9, 2018

I'm using karma-pact, which uses the node CLI/API to start the pact stub server.

@mboudreau
Copy link
Contributor

mboudreau commented May 9, 2018 via email

@TimothyJones
Copy link
Contributor

@mboudreau, if quoting is indeed the issue, then the investigation here might be useful: pact-foundation/pact-js#160

@mboudreau
Copy link
Contributor

mboudreau commented May 10, 2018 via email

@mboudreau
Copy link
Contributor

@bbarke very sorry I haven't gotten to this yet. It's been hectic at work with GDPR :/

@mboudreau
Copy link
Contributor

@bbarke good news, version 6.18.3 is going out as we speak with the windows path fixes. Please let us know how you go. Cheers.

@mefellows
Copy link
Member

Thanks Michel!

@bbarke
Copy link
Contributor Author

bbarke commented May 31, 2018

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants