question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to install private GPR npm package

See original GitHub issue

I’ve been having some issues installing a scoped package that that was published to GPR

See below for my actions file

name: run unit and coverage tests

on: [push]

jobs:
  build:

    runs-on: macos-latest

    strategy:
      matrix:
        node-version: [12.x]

    steps:
    - uses: actions/checkout@v1
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
        registry-url: 'https://npm.pkg.github.com/'
        scope: '@OWNER'
    - name: Authenticate with GitHub package registry
      run: echo "//npm.pkg.github.com:_authToken=${{ secrets.PRIVATE_ACCESS_TOKEN }}" > ~/.npmrc
    - name: npm install, build, and test
      run: |
        npm ci
        npm run test:unit
        npm run lint
        npm run test:e2e -- --headless
      env:
        CI: true

my .npmrc file is as follows:

@discoveryedu:registry=https://npm.pkg.github.com/

my private access token has read:packages, write:packages, and repo privileges.

I’m getting the following error in actions:

npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/download/@owner/repo/version/17acfb4437fa36d9d3a823706515a97591ef1ca93a2cc3abb943b333734672d1

i’ve subbed the owner, repo, and version names for privacy.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bryanmacfarlanecommented, Jun 30, 2020

Per @joebowbeer , would it just work if you set NODE_AUTH_TOKEN envvar and didn’t echo to the npmrc file?

0reactions
dmitry-shibanovcommented, Nov 15, 2021

Hello everyone. Thank you for your responses. I’m going to close, because I could not reproduce it. It looks like the issue from customer’s set up. @ssylvester If you have any concerns feel free to contact us.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Github actions: Unable to install private GPR npm package
I've been having some issues installing a scoped package that that was published to GPR. See below for my actions file
Read more >
Unable to install package from private npm registry
I've created a single private project that I'm only using as a centralized, remote NPM package repository. I'm able to publish packages ok....
Read more >
Host and Publish NPM package on GitHub | by Windix Feng
It supports both public and private package (based on your GitHub repo is public or private). The NPM publishing destination (rather than the...
Read more >
unable to authenticate, need: basic realm="github" - You.com
You cannot install packages (even public ones) from the GitHub npm registry without being authenticated. More details and multiple authentication methods ...
Read more >
Private NPM Packages using GitHub Actions & Packages
Learn how to use GitHub Packages to host your own private packages. ‍ Written Version:▫ Website: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found