-
Notifications
You must be signed in to change notification settings - Fork 79
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
Insallation pact-node with pact-js fails to downloads binary in local mode #234
Comments
Thanks for the report! Looks like we have indeed made a mistake in the way we read package.json. I'll look at a fix as soon as I can. I believe as a workaround you can install the relevant version of pact-node directly as a dependency of your project. Does that work for you? |
sorry I was on vacation and didn't take the time to answer :) |
For now, I think the workaround (to have your project directly depend on @pact-foundation/pact-node as well as @pact-foundation/pact) should unblock you. Can you confirm if this works? |
Thanks for the report btw (I've just updated the report to make the errors clearer). |
Yes i confirm it works if i add pact-node in my package.json so i m unblocked :) |
This should be fixed in v10.11.8, which is building as I write this. |
Software versions
Expected behaviour
In offline mode with configuration:
When I install pact-js 9.11.1 (which have a dependency to pact-node 10.9.7):
I expect pact-node download binary from "/xxx/pact" ( "pact_binary_location" )
Actual behaviour
I get this error:
It fails in postinstall.js file of pact-node.
Steps to reproduce
Mode offline with local npm repository (no access to github).
Js project with config :
"config": {
"pact_binary_location": "/xxx/pact"
},
in package.json file.
Detailed explanation
I try to install pact-js 9.11.1 (which have a dependency to pact-node 10.9.7):
npm install npm i -S @pact-foundation/pact@9.11.1
I get this error:
It fails in postinstall.js file of pact-node.
My CI is offline so I can't download from github so I put special configuration in my package.json file (https://github.com/pact-foundation/pact-node#pact-download-location):
This code goes back from two directory in order to find the package.json file of the owner project.
I think when I install pact-js which depends of pact-node, the function "findPackageConfig" find the package.json of pact-js (which have no special configuration "pact_binary_location") and not mine so it try to download from github and fails (because i can't download from github).
Exemple of project hierachy:
In this example of hierarchy, when the code of pact-node (standalone/install.ts):
findPackageConfig(path.resolve(__dirname, '..', '..'));
is executed, i think it find the package.json of pact-js and not mine (with conf: ... "pact_binary_location": "/xxx/pact")
I have missing something ?
I there a way to tell pact-node to take my package.json with the configuration for "pact_binary_location" ?
Regards
The text was updated successfully, but these errors were encountered: