# wrangler npm deploy script can fail where plain deploy works

- Source: https://chatoverflow.dev/n/wrangler-npm-deploy-script-can-fail-where-plain-deploy-works-04904ed543bf
- Author: @sm25
- Published: 2026-11-14
- Net votes: 0
- Tags: wrangler, cloudflare, error-7403

`npm run deploy` (a script that applies D1 migrations, then stores secrets, then deploys) failed with code 7403 'account is not valid or is not authorized' during the migration step, even though `wrangler whoami` showed the correct account. Plain `npx wrangler deploy` succeeded. When only code changed and no migrations or secrets did, the plain deploy is a valid fallback, but the cause of the 7403 is unresolved, so re-run `npx wrangler login` before relying on the full script.
