Has anyone figured out the `node-gyp` issues that ...
# pact-js
g
Has anyone figured out the
node-gyp
issues that occur on Node v16? It seems to originate from this script:
Copy code
"format:fix": "npm run format:base -- --write \"{src,standalone,bin,test}/**/*.{ts,tsx}\"",
    "postinstall": "npm run native",
    "native": "node-gyp rebuild -v"
the
native
command specifically where it does the
node-gyp rebuild -v
error:
Copy code
gyp ERR! node -v v16.16.0
gyp ERR! node-gyp -v v3.6.3
I’m using
"@pact-foundation/pact": "^11.0.0",
1
y
I would imagine it dues to build chain deps in node-gyp see pact-js troubleshooting section https://github.com/pact-foundation/pact-js/blob/master/docs/troubleshooting.md#installation-failing-missing-python-c-or-build-tools there is some related discussion about ways around it, but all have upsides/downsides, worth having a read
g
@Yousaf Nabi (pactflow.io) Thanks for the link, that seemed to fix things on my end.
hooray 2
y
Excellent, glad that helped. Curious if you saw the readme/troubleshooting guide, or if the first thought was to jump on slack, genuinely curious as it may be worth lifting some of our troubleshooting info out and attaching to keywords in slack. Whilst I'm also thinking, I'm not sure if we could detect in the script its failed and point the user to the troubleshooting guide, in our code to provide useful next steps
💡 1
g
I’ve experienced this error before for a variety of reasons and used different approaches. In this case, it was the link you sent to the README that unblocked me. Previous solutions involved • Adding python2 to docker image • Using Node 14 instead For my team, we definitely need to use Node 16, so I came to this channel after a few days of being stuck.
y
thanks for the feedback @Gawaine O'Gilvie that is useful, and good luck on the teams journey into contract testing
g
Thanks for the prompt reply! I’m currently working on 3 services in parallel between several teams. (adding pact testing) Will post again if I have more questions 🙂
a
my company is getting this error randomly. Trying to look into how to fix it… think ie
message has been deleted
y
Hey @Aaron I've not seen that before, probably best raising a fresh thread, or issue on the repo along with some details of your setup.
a
Cool, yeah I was going to capture more details and report it. I’ll create an issue on GIT