Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: Project specific .yarnrc.yml npmAlwaysAuth not respected #6509

Open
1 task
drodil opened this issue Sep 18, 2024 · 0 comments
Open
1 task

[Bug?]: Project specific .yarnrc.yml npmAlwaysAuth not respected #6509

drodil opened this issue Sep 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@drodil
Copy link
Contributor

drodil commented Sep 18, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

In the project I have the following .yarnrc.yml:

httpTimeout: 30000

nodeLinker: node-modules

npmAlwaysAuth: true

npmRegistryServer: 'https://company.xyz/api/npm/registry'

npmPublishRegistry: 'https://company.xyz/api/npm/registry'

yarnPath: .yarn/releases/yarn-4.5.0.cjs

yarn npm login is successful but when running yarn npm info lodash I get an error

➤ YN0041: Invalid authentication (as an anonymous user)

If I add the npmAlwaysAuth to the registry specific config in ~/.yarnrc.yml, the npm info works. My ~/.yarnrc.yml:

npmRegistries:
  "https://company.xyz/api/npm/registry":
    npmAlwaysAuth: true # This is required
    npmAuthToken: ***

It seems to also work if I add this to project .yarnrc.yml:

npmRegistries:
  'https://company.xyz/api/npm/registry':
    npmAlwaysAuth: true

Shouldn't the top level npmAlwaysAuth in the project force the authentication for all requests to all registeries like wanted?

To reproduce

See description above.

Environment

System:
    OS: macOS 14.6.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 18.19.0 - /private/var/folders/jx/6_rpw_wd31bc2sxg5brx5j780000gn/T/xfs-25f595b7/node
    Yarn: 4.5.0 - /private/var/folders/jx/6_rpw_wd31bc2sxg5brx5j780000gn/T/xfs-25f595b7/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm

Additional context

No response

@drodil drodil added the bug Something isn't working label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant