antfu-collective / taze

🥦 A modern cli tool that keeps your deps fresh
MIT License
2.88k stars 85 forks source link

taze now throws 401 errors when using a custom repository #122

Closed tommcquarrie closed 4 months ago

tommcquarrie commented 5 months ago

Describe the bug

We use azure devops as a package repository and mirror which is configured via .npmrc. From taze 0.14.0 and up it fails to fetch the package versions, throwing a string of 401 errors for each package. I tried setting --loglevel debug but it doesn't provide any additional output.

Our redacted .npmrc file looks like the below:

registry=https://pkgs.dev.azure.com/#####/_packaging/#####/npm/registry/

always-auth=true

; begin auth token
### auth token here
; end auth token

Command output:

yarn taze
 ERROR

> @apollo/client unknown error
401
> @azure/web-pubsub-client unknown error
401
> @ckeditor/ckeditor5-react unknown error
401
> @emotion/react unknown error
401
... 

I'd be happy to try and raise a PR but if I was to, aside from digging into the complexities of npm header configuration, I'd say the fix would be to revert the 0.14.0 performance fix. I think the new way you're fetching versions via raw $fetch instead of npmRegistryFetch.json might not sufficiently support the various ways npm can be configured. And not sure about anyone else but I really didn't see perf as an issue.

Reproduction

configure custom repository, run npx taze

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 71.83 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.3 - ~/.nvm/versions/node/v18.20.3/bin/node
    Yarn: 3.1.1 - ~/.nvm/versions/node/v18.20.3/bin/yarn
    npm: 10.8.1 - ~/Documents/Repos/client-api-auth/node_modules/.bin/npm
  Browsers:
    Chrome: 126.0.6478.127
    Edge: 126.0.2592.87
    Safari: 17.5

Used Package Manager

yarn

Validations

Contributions

Lemonreds commented 5 months ago

same question