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.

github tarball url in package-lock breaks builds that use private registries and always-auth = true

See original GitHub issue

For users who:

  • Are using a private npm registry like Artifactory
  • and running npm install in a docker build,
  • but do not want to (or cannot, for regulatory/security purposes) pollute their docker image with a github token,

… the following change has broken the installation of winston-daily-rotate-file:

https://github.com/winstonjs/winston-daily-rotate-file/commit/1254aa01e4bb4bd944a5946f864dc64c456e03fb

In the conditions above, this change produces the following error:

44 verbose stack Error: Unable to authenticate, need: Basic realm="GitHub"
44 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:107:17
44 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:97:5)
45 verbose statusCode 401
46 verbose pkgid winston-transport@https://github.com/winstonjs/winston-transport/archive/868d6577956f82ee0b021b119a4de938c61645f7.tar.gz

The reason for this error seems to be that when always-auth = true is in play npm attempts to authenticate with github instead of just fetching the tarball as a public non-authed user.

There doesn’t appear to be an easy fix for those of us who have the above requirements except to pin to an earlier version of the package and hope that the github URL eventually disappears from the package-lock.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mattberthercommented, May 6, 2021

Would the fix proposed in #315 actually solve this problem and the problem from #314 while making sure the ts typings work as expected (#297)?

1reaction
mattberthercommented, May 7, 2021

Thanks for the feedback. I’ve merged #315 and pushed as winston-daily-rotate-file@4.5.5. This should hopefully address all of the problems in the best way possible. Meanwhile, I’ll track winston-transport and will remove the workaround once a new version is pushed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

4.5.3 requires github access to install... · Issue #314
github tarball url in package-lock breaks builds that use private registries and always-auth = true #316. Closed. @Maciek416. Copy link ...
Read more >
[BUG] NPM v7 private registry authentication 401 (v6 works)
When I fetch the tarball urls from the github registry, they do redirect, but the new auth is baked into the query parameters...
Read more >
install private repositories · Issue #636 · microsoft/Oryx - GitHub
I have a private npm registry hosted in GitHub and this is how I have in my npm registry: Here the ${GITHUB_TOKEN} is...
Read more >
[BUG] Automatic authentification on private npm repository no ...
We use a private nexus repository with an .npmrc file on each project. Our .npmrc looks like (URL changed for this bug report):....
Read more >
Can't use handleRejections: true with DailyRotateFile and ...
The option handleRejections: true is supported by winston itself in ... github tarball url in package-lock breaks builds that use private ...
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