ARTIFACTORY: Why Some npm Packages Return 404 Error Messages

ARTIFACTORY: Why Some npm Packages Return 404 Error Messages

Products
Frog_Artifactory
Content Type
Use_Case
AuthorFullName__c
Andrey Granovsky
articleNumber
000004183
FirstPublishedDate
2018-06-05T13:10:45Z
lastModifiedDate
2018-06-05
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:
  1. 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.
  2. After that, go to the UI, click on Artifacts, right-click on the name of your npm cache repository, and select Zap Cache.