Why am I getting 404 for some npm packages?

Mohammad Tibi
2019-07-14 15:13


Some remote npm packages return 404 when trying to resolve with Artifactory

Affected Versions

All versions 


As for today, Artifactory before sending a GET request to resolve a package from a remote endpoint, sends a HEAD request to this endpoint, once it gets 200 for the HEAD request, it will send a follow-up GET request. This is how Artifactory works with all remote repositories regardless of the package types.

When working with "https://registry.npmjs.org/", sometimes, the HEAD request gets a 404 response even though the package exists. This causes Artifactory to not send a GET request to resolve the package and it is failing the entire request.

As "https://registry.npmjs.org/" does not send 404 for all HEAD requests,, some packages get installed successfully and some fail.



Please use following steps to work around this issue (requires Artifactory version 5.5.2 and above)

  1. in the npm-remote repository, in the Advanced Tab, enable the "Bypass HEAD Requests" so we won't send "https://registry.npmjs.org/" HEAD requests.
  2. Once you enable it, From the UI -> click on Artifacts, right click on the npm-repository name -> Zap cache.

Then we will be able to resolve the packages that return 404 for HEAD requests.