Resolving NPM Errors Preventing Docker for Sitecore from Starting

Diagnosing and fixing Docker start failures caused by NPM registry DNS issues.

July 4, 2025

By Brad Fettes

Diagnosing and Fixing Docker Start Failures Caused by NPM Registry DNS Issues

So you’ve been away on holiday or were working remotely for a while and everything was good. Then you come home and go to bring up your Sitecore Docker instance but suddenly you’re running into some unexpected npm errors that are preventing you from starting up your Docker image.

PS C:\Source\Website\local-containers> docker-compose up -d
Running 0/8

[+] Network website_default         Created
[+] Container website-mssql-1       Healthy
[+] Container website-solr-1        Healthy
[+] Container website-solr-init-1   Started
[+] Container website-mssql-init-1  Started
[+] Container website-cm-1          Error
[+] Container website-rendering-1   Started
[+] Container website-traefik-1     Created

dependency failed to start: container website-cm-1 is unhealthy

PS C:\Source\Website\local-containers>

What Could Be Causing the Website-cm-1 Container to Error Out?

Start off by checking the Logs tab in Docker. You may see a DNS resolution issue for registry.npmjs.org.

NPM error log showing EAI_AGAIN error during request to registry.npmjs.org

If this is the case, then the first thing we want to do is ensure that we have fully rebooted the host machine and have connected to the internet successfully. If you’ve just left your laptop in suspend or hibernate mode it may not have properly disconnected from the old network and connected to the new one.

Assuming that has been done, ensure that there are no issues on the host machine when it comes to resolving the domain name. To do so, start off by opening command prompt and running this command:

ping registry.npmjs.org

You should get a response like the following:

Command prompt showing successful ping responses from registry.npmjs.org

If you are getting replies in a reasonable amount of time, as you can see in this example, then everything is good there. Alternatively, you may get messages indicating the request has timed out. If it is timing out then that indicates a more severe network connection issue than something preventing it from accessing the NPM registry.

If this is the case I would next test your overall network connectivity by trying to ping or access common sites like google.com and also ensuring there isn’t a Firewall, VPN or proxy in place that may also be contributing to the issue. And of course, ensure that your computer is connected and that your modem is currently connected to the internet.

Assuming you were able to ping the NPM registry successfully, next try running nslookup on the domain:

nslookup registry.npmjs.org

This will show all of the IP addresses the domain can be resolved to. You should see a response like the following:

Command prompt with nslookup output for registry.npmjs.org, showing DNS timeouts and multiple IP addresses

In this case it actually reveals something quite telling. The DNS request timed out twice before using the Non-authoritative Answer with multiple IPs. This tells us it is not properly resolving the IP address.

From here you will want to do a Network Reset, to do so go to your Windows Settings → Network & Internet → Advanced Network Settings

Windows 11 settings screen with

Now click Network Reset → Reset Now.

This will restart your PC, during which it will remove and reinstall all of your network adapters.

After that has completed start up your Docker image again using docker compose up -d and the issue should be resolved!

Fishtank logo icon

Brad Fettes

Solution Architect

Brad is a seasoned Solutions Architect specializing in Sitecore, with extensive experience in Sitecore XM Cloud and enterprise-scale digital transformation. He excels in architecting headless solutions, automating DevOps pipelines, and leveraging cloud platforms like Azure and Vercel to streamline deployments and optimize performance.