Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

npm GitHub Packages(https://npm.pkg.github.com) as Connector Feed



  • I'm trying to create a Connector Feed for npm packages from GitHub Packages. I was able to successfully do this with NuGet Packages without any issues. However when trying to auth with npm I'm getting the following error:

    Unable to query https://npm.pkg.github.com/

    I've tried https://npm.pkg.github.com/OWNER as the URL I've tried using @NAMESPACE:registry=https://npm.pkg.github.com without any luck.

    I couldn't find any docs on how to actually do this. Has anybody done this and know what is the correct format to authenticate appropriately ?


  • inedo-engineer

    Hi @devopsdude3113 ,

    GitHub npm connectors work a bit differently than other connectors. GitHub does not implement the full npm API specification so certain things like package count and the search API are not working. To get around this in ProGet 2023, you will need to make sure that you have updated to at least ProGet 2023.20 and use the following settings:

    1. On the General tab
      1. For the URL use https://npm.pkg.github.com/<OWNER>
      2. For Authentication
        1. Use Basic auth
        2. For the username, use your GitHub user name
        3. For the password, use your and then use a Personal Access Token (classic)
    2. On the Advanced tab
      1. Check "Exact package name match only"
      2. Check "Do not perform health check"

    That should allow you to search for the package by full name and allow your npm applications to pull the packages properly. Please note that partial name searches will not return any values from your GitHub connector since the search API has not been implemented.

    Please let me know if these steps fix your issue or if you have any other questions. I have also added a section to our docs to include setting up a GitHub connector as well. You can see this in the Troubleshooting section of our npm docs.

    Thanks,
    Rich



  • Hi @rhessinger,

    thank you so much for the help! I was able to finally connect to it! Also thanks for adding the documentation!! ✨

    Quick question, you mentioned

    certain things like package count and the search API are not working

    Would this statement also include the list of packages in Feeds > mynpm-feed ? the list of packages here wouldn't show up correct ? but they should show up if in the UI if search for the package exactly ?

    Or would the search (and finding) of the package only work if I pull it locally against my Proget registry ?

    Thanks again!


  • inedo-engineer

    Hi @devopsdude3113,

    The package count is what we check for the connector health, so it will always show 0 connector packages in the GitHub connector, and the search API is what allows you to partial search for packages in the remote repository. Once a package has been pulled locally to ProGet or has been cached in ProGet, then those packages will show on your list packages page and will allow partial name searching against them. When they have not been cached or pulled to ProGet, those only exist remotely in the GitHub repository and require that you type the exact name to see them in ProGet.

    Thanks,
    Rich



  • Hi @rhessinger,

    Interesting, thank you for that.

    So I was able to create the connector but it seems that I am no viewing any packages yet 😞

    On the Feed > mynpm-feed I get the following message:

    There are no local Packages in this feed and the connectors did not list any remote packages. This may happen if there was an error connecting to the remote feed or the connector is configured to filter packages.

    I've tried pulling locally too while pointing my .npmrc file to my ProGet instance and I'm getting Package not found.

    What could be a reason that it is not pulling packages, but no error is being thrown at the connector level ? Any ideas?

    Thanks


  • inedo-engineer

    Hi @devopsdude3113,

    When you are searching for your package, are you searching using @owner/package-name? GitHub only supports scoped packages, so the exact name requires the scope too. Also, if you have already pulled the package directly from GitHub, you will need to clear your local npm cache before it will attempt to pull from ProGet. Also, please verify only your ProGet repository is configured for your @owner scope in your npmrc file.

    Thanks,
    Rich



  • Hi @rhessinger ,

    appreciate your support here.

    Yeah I have been searching many different ways 😅 hehe but no luck.

    I've tried even locally with npm install @owner/package without any luck.

    .npmrc file looks like this if it helps:

    //http://proget-server/npm/github-feed:_auth=<auth_token>
    registry=http://proget-server/npm/github-feed
    @owner:registry=http://proget-server/npm/github-feed
    

    I just added the last line of @owner as to determine the scope, and still no luck.

    I tried looking in the logs within my Proget Server and I don't see any authentication errors (not sure if they would show up)

    I do see the requests coming through but all I see is:

    2023-10-24 11:44:49 An error occurred processing a GET request to http://proget-server/npm/github-feed/@owner%2fnpm-package: Package was not found.
    2023-10-24 11:44:49 info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
    2023-10-24 11:44:49       Request finished HTTP/1.1 GET http://proget-server/npm/github-feed/@owner%2fnpm-package - - - 404 64 application/json 540.1975ms
    2023-10-24 11:44:49 info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
    2023-10-24 11:44:49       Request starting HTTP/1.1 GET http://proget-server/npm/github-feed/@owner%2fnpm-package - -
    2023-10-24 11:44:50 A 404 error occurred in github-feed: Package was not found.
    2023-10-24 11:44:50 A 404 error occurred in github-feed: Package was not found.
    

    updated the actual @myownername by just @owner and package-name by `npm-package to avoid any unintentional info going out 😅


  • inedo-engineer

    Hi @devopsdude3113,

    When you search for the package by exact name in ProGet (ex: @owner/npm-package), are you able to see it?

    Thanks,
    Rich



  • Hi @rhessinger,

    nope, I can't see. Nothing shows up 😞 unfortunately,

    Thanks


  • inedo-engineer

    Hi @devopsdude3113,

    What scopes do you have configured for your personal access token? When I tested this, I created a personal access token and added only the read:packages scope.

    Also, do you see any error in your ProGet diagnostic center?

    Thanks,
    Rich


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation