Pact-js: Hangs indefinitely when installing on WSL2 (Windows + Ubuntu 20)

Created on 29 May 2020  路  3Comments  路  Source: pact-foundation/pact-js

Software versions

  • OS: Windows 10 (WSL2 Ubuntu 20.04)
  • Consumer Pact library: latest
  • Provider Pact library: n/a
  • Node Version: 14.3.0
  • Package Manager: yarn 1.22.4 & npm 6.14.5

Confirm the following:

  • [x] I have upgraded to the latest
  • [ ] I have created a reproducible git repository to illuminate the problem
  • [ ] I have the read the FAQs in the Readme
  • [x] I have triple checked, that there are no unhandled promises in my code

Expected behaviour

To complete installation

Actual behaviour

Hangs indefinitely

Steps to reproduce

With a fresh copy of Ubuntu 20.04 on Windows 10 running inside WSL2 run:

npm

~ mkdir pact-example
~ cd pact-example
~/pact-example npm install @pact-foundation/pact

It will hang indefinitely here:

image

Yarn

~ mkdir pact-example
~ cd pact-example
~/pact-example yarn add @pact-foundation/pact

It will hang indefinitely here:

image

Most helpful comment

Sorry for the delay in responding and thank you for taking the time to investigate!

It seems that this issue presents itself when pact is being installed inside WSL when done from behind a VPN. I know the VPN I am using caches npm packages so there could have been some issue in that.

However, strangely it is not occurring right now so I think we are fine to close this. I'll provide more information if the problem reoccurs.

All 3 comments

Thanks for the clear report! I tried to reproduce it with the same version of node on my mac, but it succeeds (I don't have access to a windows machine).

Some thoughts:

  • Are you able to do an npm cache verify, please?
  • Do you have a global copy of @pact-foundation/pact installed?
  • Do you experience the same issue with an earlier version of node? (say 12.17.0, which is the current LTS release)
  • What is the output of npm install --verbose @pact-foundation/pact ?

This might be a permissions thing with WSL2 and npm - what does npm config list -l say about unsafe-perm ?

Sorry for the delay in responding and thank you for taking the time to investigate!

It seems that this issue presents itself when pact is being installed inside WSL when done from behind a VPN. I know the VPN I am using caches npm packages so there could have been some issue in that.

However, strangely it is not occurring right now so I think we are fine to close this. I'll provide more information if the problem reoccurs.

Was this page helpful?
0 / 5 - 0 ratings