Skip to main content

Install/Update Wrangler

还没翻译译自英文(developers.cloudflare.com)本页 21 段都还没译

Wrangler is a command-line tool for building with Cloudflare developer products.

Install Wrangler

To install Wrangler, ensure you have Node.js and npm installed.

Use Vite+ (vp env) to install and manage Node.js versions.

For setup instructions, refer to Install vp globally. You can use vp env without adding Vite+ to your project.

Wrangler System Requirements

Wrangler is installed locally into each of your projects. This allows you and your team to use the same Wrangler version, control Wrangler versions for each project, and roll back to an earlier version of Wrangler, if needed.

To install Wrangler within your Worker project, run:

npm i -D wrangler@latest
yarn add -D wrangler@latest
pnpm add -D wrangler@latest
bun add -d wrangler@latest

Since Cloudflare recommends installing Wrangler locally in your project (rather than globally), the way to run Wrangler will depend on your specific setup and package manager. Refer to How to run Wrangler commands for more information.

Caution

If Wrangler is not installed, running npx wrangler will use the latest version of Wrangler.

Check your Wrangler version

To check your Wrangler version, run:

npx wrangler --version
// or
npx wrangler -v

Update Wrangler

To update the version of Wrangler used in your project, run:

npm i -D wrangler@latest
yarn add -D wrangler@latest
pnpm add -D wrangler@latest
bun add -d wrangler@latest
  • Commands - A detailed list of the commands that Wrangler supports.
  • Configuration - Learn more about Wrangler's configuration file.