Hey,

Hey, I'm trying to use github action to deploy our worker, using cloudflare/wrangler-action@v3. This is my yml file:
name: Deploy Worker
on:
push:
branches:
- wrangler
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Build & Deploy Worker
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: "./cloudflare-services/platforms-dispatcher"
name: Deploy Worker
on:
push:
branches:
- wrangler
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Build & Deploy Worker
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: "./cloudflare-services/platforms-dispatcher"
For some reason, it was trying to install a private npm package (from my main repo yarn.lock), failing over that:
Checking for existing Wrangler installation
/usr/local/bin/npx --no-install wrangler --version
npm error npx canceled due to missing packages and no YES option: ["[email protected]"]

npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2024-07-31T13_20_24_246Z-debug-0.log
⚠️ Wrangler not found or version is incompatible. Installing...
📥 Installing Wrangler
/usr/local/bin/npm i [email protected]
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/@wix%2fambassador-bootstrap-plugin - Not found
npm error 404
npm error 404 '@wix/ambassador-bootstrap-plugin@^1.0.617' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.

npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2024-07-31T13_20_31_572Z-debug-0.log
Checking for existing Wrangler installation
/usr/local/bin/npx --no-install wrangler --version
npm error npx canceled due to missing packages and no YES option: ["[email protected]"]

npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2024-07-31T13_20_24_246Z-debug-0.log
⚠️ Wrangler not found or version is incompatible. Installing...
📥 Installing Wrangler
/usr/local/bin/npm i [email protected]
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/@wix%2fambassador-bootstrap-plugin - Not found
npm error 404
npm error 404 '@wix/ambassador-bootstrap-plugin@^1.0.617' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.

npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2024-07-31T13_20_31_572Z-debug-0.log
I tried having
packageManager: npm
packageManager: npm
but this causes the installation to get stuck:
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
Is there an option to pre-install Wrangler? What is the best practice here? What am I doing wrong? Thanks!
1 Reply
yaniv.efraim
yaniv.efraim3mo ago
ok, I managed to fix it by adding:
- name: Install dependencies
run: npm install -g wrangler
- name: Install dependencies
run: npm install -g wrangler
Want results from more Discord servers?
Add your server