Just sharing this in case it helps someone avoid hours of frustration.
If you’ve installed the Forge CLI using pnpm
and you see this when trying to log in:
$ forge login
Log in to your Atlassian account
Press Ctrl+C to cancel.
? Enter your email: sh....
Next, enter your Atlassian API token. If you don't have a token, visit this URL to create one:
? Enter your Atlassian API token: [hidden]
✕ Logging you in...
Error: The CLI couldn't securely store your login credentials in a local keychain. Ensure you enable access to the macOS keychain when prompted. If a local keychain is not available, use environment variables before trying again.
The problem is
pnpm
breaks native module resolution for keytar
, which Forge uses to store credentials in the macOS keychain.
Fix
Uninstall the Forge CLI from pnpm
:
pnpm remove -g @forge/cli
Then reinstall it with npm
instead:
npm install -g @forge/cli
That fixes the keychain integration, and forge login
works as expected.
Related
I reported the root cause in the pnpm
repo:
keytar not found · Issue #9623 · pnpm/pnpm · GitHub
Hope this saves someone a few hours of debugging