This is so weird. It also says I'm using Wrangler 3.9, when my package.json has: ``` "devDependenc
This is so weird. It also says I'm using Wrangler 3.9, when my package.json has:
"devDependencies": {
"wrangler": "^4.6.0"
},npx from the directory containing the wrangler.json?npm i?npm i? Does the node_modules/wrangler/package.json file show "version": "4.6.0" or similar?wrangler-action? Are you pinning your wranglerVersion there in your Actions config?wrangler-action version that used to pin to a specific version?.github/workflows/<something>.yml. You likely are using an old version of wrangler-action, or have wranglerVersion pinned in itnpm i afresh to see if that flushes thingsnpx wrangler secret bulk --env stage. Are you running this locally or is it running in the Github action?npm i /usr/..., but I'm not sure where that is.
package.json?npx --no-install. Because you're not running a package manager install before the action, it's not seeing one as installed. So then it defaults to installing, and the default is 3.90.0: https://github.com/cloudflare/wrangler-action/blob/707f63750981584eb6abc365a50d441516fb04b8/src/index.ts#L8setup-node step before the deploy action, and then the npm ci, which'll run an install from your own package.json package-lock.json, so that'll have your pinned new wrangler versionwrangler-action will then see this as installed and use that versionNODE_VERSION part necessary? Doesn't that get implied via the Wrangler compatibility_date flag?node-version: ${{ env.NODE_VERSION }} config in the setup-node stepnode-version: 22npm ci commandnode_modules/wrangler/package.json"version": "4.6.0"wrangler-actionwrangler-actionwrangler-actionwrangler-actionwranglerVersionwranglerVersion.github/workflows/<something>.ymlname: Deploy
on:
push:
branches:
- main
- stage
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v3
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
environment: ${{ github.ref_name == 'main' && 'prod' || 'stage' }}
apiToken: ${{ secrets.CF_API_TOKEN }}
secrets: |
REDACTED
env:
REDACTED: ${{ secrets.REDACTED }}npx wrangler secret bulk --env stagewrangler dev --config \"dev.json\" --remote --port 1933 --env dev --test-scheduled/usr/...2025-04-08T17:39:23.4216882Z [command]/usr/local/bin/npx --no-install wrangler --version
2025-04-08T17:39:28.4759522Z npm error npx canceled due to missing packages and no YES option: ["wrangler@4.9.0"]
2025-04-08T17:39:28.4767790Z npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2025-04-08T17_39_23_900Z-debug-0.log
2025-04-08T17:39:28.4895211Z ⚠️ Wrangler not found or version is incompatible. Installing...npx --no-installsetup-nodesetup-nodenpm cinpm cicompatibility_datenode-version: ${{ env.NODE_VERSION }}node-version: 22name: Deploy
on:
push:
branches:
- main
- stage
env:
NODE_VERSION: 22.x
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm ci
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
environment: ${{ github.ref_name == 'main' && 'prod' || 'stage' }}
apiToken: ${{ secrets.CF_API_TOKEN }}
secrets: |
REDACTED
env:
REDACTED: ${{ secrets.REDACTED }}