Skip to content

Commit 7a11ec6

Browse files
authored
docs: update windows troubleshooting information
Users on windows must install a minimum set of tools alongside nodejs installations, in order to use pact-js. This can either be done via the official nodejs installer, with the `Tools for Native Modules` option checked, or manually by following the [instructions on node-gyps readme](https://github.com/nodejs/node-gyp?tab=readme-ov-file#on-windows) fixes pact-foundation/pact-js-core#608
1 parent eb2d5ee commit 7a11ec6

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

docs/troubleshooting.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,25 @@ Users can now use `--ignore-scripts`
296296
- follow the instructions provided
297297
- You can override the path to the pact native build with `PACT_PREBUILD_LOCATION`
298298

299+
### Windows 10 & 11 users
300+
301+
Windows users require a minimum set of tools for building native modules, as part of pact-js's pre-requisites.
302+
303+
If these are not present, the user will be presented with the following message when executing tests.
304+
305+
```
306+
Exception during run: TypeError: Cannot read properties of undefined (reading 'pactffiInitWithLogLevel')
307+
```
308+
309+
In order to install the required tools, there are a couple of ways of doing this, which may vary depending on how you choose to install NodeJS on your machine.
310+
311+
1. With the NodeJS Windows Installer Package
312+
- Ensure you select the following option
313+
- ![Image](https://github.com/user-attachments/assets/1f3bf758-30c5-44a3-a3a3-e3205ef46cd4)
314+
2. If using [nvm-windows](https://github.com/coreybutler/nvm-windows), [nvs](https://github.com/jasongin/nvs), or any other means.
315+
- [See instructions on the node-gyp repository](https://github.com/nodejs/node-gyp?tab=readme-ov-file#on-windows)
316+
317+
For more background detail, see the following [issue](https://github.com/pact-foundation/pact-js-core/issues/608#issuecomment-2698285436)
299318

300319
## ENOENT: no such file or directory, open 'node:path'
301320

@@ -309,4 +328,4 @@ Affected frameworks
309328

310329
## Why are there duplicate / extraneous interactions in my pact file?
311330

312-
You must clear out the pacts directory prior to running your tests. Pact tests may be run in parallel, which makes it difficult for Pact to know when the file is safe to clear. This is usually not a problem unless you upload from your development environment, as in CI / automation contexts, it's less likely that you have previous test runs lying around.
331+
You must clear out the pacts directory prior to running your tests. Pact tests may be run in parallel, which makes it difficult for Pact to know when the file is safe to clear. This is usually not a problem unless you upload from your development environment, as in CI / automation contexts, it's less likely that you have previous test runs lying around.

0 commit comments

Comments
 (0)