Docker Desktop Windows and VPN is faling to get npm packages

I am trying to run a docker compose file but I am receiving an error: npm ERR! request to failed, reason: connect EHOSTUNREACH 199.99.900.140:1555

However, it is working when I request from Postman, Browser, telnet the only requirement is ensure my company VPN is connected.

Looks like during code compilation in order to create the image, it is not considering retrieve npm packages using VPN. I am not sure how to ensure Docker for windows is using VPN connection.

It should use the default route of your host.
You can easily check it by using curl to access a page in your intranet.

I have a hunch: can you check the subnet wsl uses, and the routes that your vpn injects into your route table?

You can identify the wsl subnet in a Windows terminal, using the command ipconfig. The entry is called “Ethernet-Adapter vEthernet (WSL (Hyper-V firewall))”. It should tell you the first ip in the subnet and the netmask. You can enter these values in a subnet calculator like IP Subnet Calculator. For example my ipv4 address for this adapter is, and the netmask (=20 bit netmask), which has a range from -

You can see the route table in a Windows terminal, using the command route print -4. Network targets that intersect with the ranges of the wsl subnet, but are routed through the vpn will cause problem.

You need to make sure both ranges do not intersect. I found a forum post that describes how to change the ip of the wsl2 network. Make sure to save the old settings sometwhere in case it doesn’t work.

I was able to change wsl2 network ip and subnet, however, it have not work yet.

My route table

Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
     35      2      2      2         On-link    257         On-link    257         On-link    257     36      2         On-link   5256         On-link   5256      2         On-link   5256      2      2         On-link    331         On-link    331         On-link    331      2      2      2      2         On-link   5256         On-link   5256         On-link   5256      2         On-link    291         On-link    291         On-link     36         On-link    291         On-link    331         On-link    291         On-link   5256         On-link  10000         On-link   5256         On-link    331         On-link    291         On-link   5256         On-link  10000         On-link   5256

and also my new wsl2 details

Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::dd12:ad7f:602d:438b%53
   IPv4 Address. . . . . . . . . . . :
   Subnet Mask . . . . . . . . . . . :
   Default Gateway . . . . . . . . . :

Please make sure to use a subnet for the WSL network that is not publicly routed range:

  • range –
  • range: –
  • range: –

You used 8 bits for the netmask, which translates to an ip range with 16777216 ips. The 20 bits netmask that was configured by default had 4096 ips in the range. So please pick subnet within one of these ranges that is colision free with the subnets of your routing table,and collision free with docker’s subnets ranges.

You might want to get in touch with your company’s it support and ask them for assistance. If the problem is related to your vpn, then it’s high likely you are not the only one affected, so that they already know what configuration works collision free.