Introduction
Regardless of the package type, Artifactory sends a HEAD request to all remote repositories before issuing a GET request to resolve a package from a remote endpoint. If the HEAD request receives a 200 OK response, the subsequent GET request is initiated. However, with the npm public registry, the HEAD request may occasionally return a 404 error, even if the requested package is available. Consequently, Artifactory will not proceed with the GET request, leading to a failure of the entire request process. This issue typically arises when a package has not been installed successfully.
Resolution
As a workaround, please follow these steps:
- In your npm remote repository, navigate to the Advanced tab and enable the Bypass HEAD Requests option. This will prevent HEAD requests from being sent to the npm public registry.
- After that, go to the UI, click on Artifacts, right-click on the name of your npm cache repository, and select Zap Cache.