Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-20761

Artifactory npm remote to GitHub Packages doesn't work

    XMLWordPrintable

    Details

    • Severity:
      High

      Description

      GitHub Packages only supports Scoped packages:

      https://help.github.com/en/github/managing-packages-with-github-packages/configuring-npm-for-use-with-github-packages#publishing-a-package:
      ^^^ Search for "GitHub Packages only supports scoped npm packages"

      Artifactory can receive back the package.json (npm metadata) from Github correctly. However it will still fail due to a JSON parsing issue and will a 404 to the client as result.

      Steps to reproduce:

      1. Steps to configure the remote:

      a. Utilize the following URL: https://npm.pkg.github.com
      b. You must enable the Bypass HEAD request on the remote
      c. Define the Github User + Access Token (generate it from your GitHub account page)

      2. Upload and resolve a package to GitHub Packages by following this guide:

      https://help.github.com/en/github/managing-packages-with-github-packages/configuring-npm-for-use-with-github-packages#publishing-a-package

      Or; use the below command to retrieve an already published test package:

      url -Lvv "http://localhost:8080/artifactory/api/npm/npm-github/@andreikom/npmtest" -uadmin:password 
      

      You will get the following error in the log:

      2019-12-02T15:32:41.784Z [jfrt ] [ERROR] [e458f73bd1278d0 ] [a.n.r.NpmRemoteRepoHandler:459] [ttp-nio-8082-exec-17] - Error while parsing the response of a remote npm JSON query on 'https://npm.pkg.github.com/@andreikom%2Fnpmtest': Invalid package.json format. The dependencies field cannot be parsed. (through reference chain: org.jfrog.repomd.npm.model.NpmPackageMetadata["versions"]->org.jfrog.repomd.npm.model.NpmMetadata["dependencies"])
      

        Attachments

          Activity

              People

              Assignee:
              barakh Barak Hacham
              Reporter:
              andreik Andrei Komarov
              Votes:
              5 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: