Hi. I have downloaded the <example-provider> and <...
# general
a
Hi. I have downloaded the example-provider and example-consumer. Both of them are failing at npm install. Did anyone encounter this issue?
y
can you provide more info, there an many numbers of reasons an npm install may fail… what node version, what os, what actual error message
a
sure. I am running this on Mac OS, M3 chip. Node version is v18.20.3. The following is the errors I am getting on npm i
Copy code
npm install
npm warn deprecated rimraf@2.6.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See <https://v8.dev/blog/math-random> for details.
npm warn deprecated request@2.88.2: request has been deprecated, see <https://github.com/request/request/issues/3142>
npm error code 1
npm error path /Users/anma09/Documents/workspace/contract-testing/example-provider/node_modules/@pact-foundation/pact-core
npm error command failed
npm error command sh -c node-gyp rebuild
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@10.1.0
npm error gyp info using node@18.20.3 | darwin | arm64
npm error gyp info find Python using Python version 3.12.4 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
npm error gyp http GET <https://nodejs.org/download/release/v18.20.3/node-v18.20.3-headers.tar.gz>
npm error gyp WARN install got an error, rolling back install
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: ENOENT: no such file or directory, open '/Users/anma09/Documents/workspace/contract-testing/example-provider/certs/_.bde.local.cer'
npm error gyp ERR! System Darwin 23.5.0
npm error gyp ERR! command "/Users/anma09/.nvm/versions/node/v18.20.3/bin/node" "/Users/anma09/.nvm/versions/node/v18.20.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /Users/anma09/Documents/workspace/contract-testing/example-provider/node_modules/@pact-foundation/pact-core
npm error gyp ERR! node -v v18.20.3
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok

npm error A complete log of this run can be found in: /Users/anma09/.npm/_logs/2024-07-04T09_56_59_011Z-debug-0.log
should I have any file here ->
Copy code
npm error gyp ERR! stack Error: ENOENT: no such file or directory, open '/Users/anma09/Documents/workspace/contract-testing/example-consumer/certs/_.bde.local.cer'
y
no that is weird and unexpected, however you can resolved by updating the pact dep to v12 or later which have pre built bindings rather than the user requiring to build on their machine https://github.com/pact-foundation/pact-js/blob/master/docs/troubleshooting.md#installation-failing-missing-python-c-or-build-tools
👀 1
you can also raise an issue on the repo to update the version. you are welcome to make a pr to update or we will pick it up at some point
a
let me see if the --ignore-scripts works
y
it wont for v10/v11 as it wont trigger the node gyp build step with that set :(
a
the install worked with ignore scripts. For both consumer and provider. However, the consumer is not communicating with the provider. Might be a port issue.
also, shall I update this so? "@pact-foundation/pact": "^10.1.4",
ok things are running. Thanks for your help
y
great stuff Andrea, no problem
🙌 2
a
@Yousaf Nabi (pactflow.io)
can you help me with this?