Skip to content

Commit

Permalink
Merge pull request #245 from Cherry/fix/packageManager
Browse files Browse the repository at this point in the history
docs: remove warning about packageManager and pnpm default
  • Loading branch information
IgorMinar authored Mar 26, 2024
2 parents c214b69 + 4bf3047 commit fd98a7c
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
packageManager: pnpm # you can omit this if you use npm
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
```
Expand All @@ -53,10 +52,6 @@ jobs:

## Configuration

### packageManager

⚠️ you must specify package manager. If not specified GH action assumes you are using npm and other managers might be failing. For example pnpm will fail with: `Cannot read properties of null (reading 'matches')`

If you need to install a specific version of Wrangler to use for deployment, you can also pass the input `wranglerVersion` to install a specific version of Wrangler from NPM. This should be a [SemVer](https://semver.org/)-style version number, such as `2.20.0`:

```yaml
Expand Down Expand Up @@ -273,6 +268,22 @@ The resulting output will look something like this:
https://<your_pages_site>.pages.dev
```

### Using a different package manager

By default, this action will detect which package manager to use, based on the presence of a `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, or `bun.lockb` file.

If you need to use a specific package manager for your application, you can set the `packageManager` input to `npm`, `yarn`, `pnpm`, or `bun`. You don't need to set this option unless you want to override the default behavior.

```yaml
jobs:
deploy:
steps:
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
packageManager: pnpm
```

## Troubleshooting

### "I just started using Workers/Wrangler and I don't know what this is!"
Expand Down

0 comments on commit fd98a7c

Please sign in to comment.