3 ms·
npx create-deadlight-blog my-blog . . . Error: In a non-interactive environment, it's necessary to set a CLOUDFLARE_API_TOKEN environment variable for wrang
by lazylizard 10mo ago
npx create-deadlight-blog my-blog
.
.
.
Error: In a non-interactive environment, it's necessary to set a CLOUDFLARE_API_TOKEN environment variable for wrangler to work. Please go to https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ https://developers.cloudflare.com/fundamentals/api/get-start... for instructions on how to create an api token, and assign its value to CLOUDFLARE_API_TOKEN.
- gnarzilla_ 10mo agoYou need to set environment variables in your terminal, before running (or re-running) the npx command export CLOUDFLARE_ACCOUNT_ID="your-account-id-here" export CLOUDFLARE_API_TOKEN="your-token-here" Both account ID and API token can be found in the Cloudflare dashboard, after you've created a CF account. OR - I have updated the newest version with a built-in fix, token prompt if browser login fails. v1.0.6 Re-run: npx create-deadlight-blog@latest It'll: 1. Try browser `wrangler login`. 2. Fallback: Prompt `CLOUDFLARE_API_TOKEN` + `ACCOUNT_ID` (no pre-export needed). 3. Proceed to D1/deploy. *Get token* (if needed): 1. [dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens https://dash.cloudflare.com/profile/api-tokens) → Custom: - Cloudflare D1 *Edit* (Account). - Cloudflare Workers Scripts *Edit* (Account). - Cloudflare Workers KV *Edit* (Account). 2. Account ID: Dashboard → Account Home (right sidebar). Tested headless—works