I'm struggling with wrangler OAuth authentication on macOS (m1 Sonoma)

I'm attempting to setup a new worker on my m1 mac (I haven't set one up on this machine before). As part of the login process, I need to login to cloudflare, but it doesn't appear to be working. When I run npx wrangler login in terminal, it opens Safari (but same results in Chrome), I follow the login process, but then it redirects to a local host address (localhost:8976/oauth/callback?code=...), safari fails to load with the error Safari can't connect to the server "localhost". I've tried with Chrome, and get similar results. Additionally, the following output is printed to the console:
⛅️ wrangler 3.11.0
-------------------
Attempting to login via OAuth...
Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=...
/Users/matt/Development/RemixCD/remixcontent/node_modules/wrangler/wrangler-dist/cli.js:29374
throw a;
^

Error: EACCES: permission denied, mkdir '/Users/matt/.wrangler/config'
at mkdirSync (node:fs:1382:3)
at writeAuthConfigFile (/Users/matt/Development/RemixCD/remixcontent/node_modules/wrangler/wrangler-dist/cli.js:120783:33)
at Server.<anonymous> (/Users/matt/Development/RemixCD/remixcontent/node_modules/wrangler/wrangler-dist/cli.js:120875:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/Users/matt/.wrangler/config'
}

Node.js v19.6.0
⛅️ wrangler 3.11.0
-------------------
Attempting to login via OAuth...
Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=...
/Users/matt/Development/RemixCD/remixcontent/node_modules/wrangler/wrangler-dist/cli.js:29374
throw a;
^

Error: EACCES: permission denied, mkdir '/Users/matt/.wrangler/config'
at mkdirSync (node:fs:1382:3)
at writeAuthConfigFile (/Users/matt/Development/RemixCD/remixcontent/node_modules/wrangler/wrangler-dist/cli.js:120783:33)
at Server.<anonymous> (/Users/matt/Development/RemixCD/remixcontent/node_modules/wrangler/wrangler-dist/cli.js:120875:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/Users/matt/.wrangler/config'
}

Node.js v19.6.0
It appears similar to this bug, that was closed: https://github.com/cloudflare/workers-sdk/issues/2433. I'm unsure how to proceed. Does wrangler have another method for logging in? Has anyone else seen this?
GitHub
Issues · cloudflare/workers-sdk
⛅️ Home to Wrangler, the CLI for Cloudflare Workers® - Issues · cloudflare/workers-sdk
1 Reply
mattcox27
mattcox27OP15mo ago
That seems to have solved the problem. Now I feel like an idiot. Thanks for the help.
Want results from more Discord servers?
Add your server