8000 `pnpm config get` on keys containing a forward slash (`/`) returns `undefined` · Issue #9345 · pnpm/pnpm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pnpm config get on keys containing a forward slash (/) returns undefined #9345

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

Closed
jackgdll opened this issue Mar 28, 2025 · 1 comment · Fixed by #9346
Closed

pnpm config get on keys containing a forward slash (/) returns undefined #9345

jackgdll opened this issue Mar 28, 2025 · 1 comment · Fixed by #9346
Assignees

Comments

@jackgdll
Copy link

Last pnpm version that worked

10.6.5

pnpm version

10.7.0

Code to reproduce the issue

In pnpm@10.7.0 running pnpm config get [key] or pnpm get [key] where [key] contains a / always prints undefined regardless of whether the value is set or not

Expected behavior

pnpm config set key-containing-/slash value

pnpm config get key-containing-/slash
# prints 'value'

Actual behavior

pnpm config set key-containing-/slash value

pnpm config get key-containing-/slash
# prints 'undefined'

Additional information

I encountered this while attempting to get the current npm token with pnpm config get //registry.npmjs.org/:_authToken in a build script.

This is an issue for any key containing a /, I am not aware of any other problematic characters.
Quoting the key doesn't fix the issue.

pnpm config delete also has the same issue: config keys containing a / can't be deleted

Node.js version

v22.14.0

Operating System

macOS

@zkochan zkochan self-assigned this Mar 29, 2025
@zkochan
Copy link
Member
zkochan commented Mar 29, 2025

We will fix it but it still won't return the token. The npm registry auth related settings are managed by npm CLI and npm CLI throws an error when someone tries to read the auth token via CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0