Wrangler is a command-line tool for building with Cloudflare developer products.
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
We support running the Wrangler CLI with the Current, Active, and Maintenance ↗︎ versions of Node.js. Your Worker will always be executed in workerd, the open source Cloudflare Workers runtime.
Wrangler is only supported on macOS 13.5+, Windows 11, and Linux distros that support glib 2.35. This follows workerd's OS support policy ↗︎.
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@latestyarn add -D wrangler@latestpnpm add -D wrangler@latestbun add -d wrangler@latestSince 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.
To check your Wrangler version, run:
npx wrangler --version
// or
npx wrangler -vTo update the version of Wrangler used in your project, run:
npm i -D wrangler@latestyarn add -D wrangler@latestpnpm add -D wrangler@latestbun add -d wrangler@latestIf your network uses TLS inspection, for example through a corporate proxy or VPN, Wrangler does not trust the certificate that the network presents. Wrangler commands then fail with the following output:
▲ [WARNING] Wrangler detected that a corporate proxy or VPN might be enabled on your machine, resulting in API calls failing due to a certificate mismatch. It is likely that you need to install the missing system roots provided by your corporate proxy vendor.
▲ [WARNING] A fetch request failed, likely due to a connectivity issue.
✘ [ERROR] fetch failedIf your login has expired, Wrangler reports the same problem as Your auth token has expired and could not be refreshed because the Cloudflare auth server could not be reached. Other Node.js tools report it as SELF_SIGNED_CERT_IN_CHAIN or UNABLE_TO_VERIFY_LEAF_SIGNATURE.
To fix this, obtain your organization's CA certificate in PEM format. If your organization uses Cloudflare Gateway, download the Cloudflare root certificate. Then set the NODE_EXTRA_CA_CERTS ↗︎ environment variable to the path of the certificate:
export NODE_EXTRA_CA_CERTS="/path/to/company-ca.pem"To keep the setting for new terminal sessions, add this line to your shell profile, for example ~/.zshrc or ~/.bashrc.
$env:NODE_EXTRA_CA_CERTS="C:\path\to\company-ca.pem"To keep the setting for new PowerShell sessions, add this line to your PowerShell profile. To find the profile path, run echo $PROFILE.
set NODE_EXTRA_CA_CERTS=C:\path\to\company-ca.pemTo keep the setting for new Command Prompt windows, run setx NODE_EXTRA_CA_CERTS C:\path\to\company-ca.pem. setx does not change the current window.
Node.js reads NODE_EXTRA_CA_CERTS only when it starts, so set it before you run Wrangler. The variable applies to every Wrangler command in that session, including wrangler dev, where it also lets fetch() requests from your Worker trust the certificate. To confirm that Wrangler can reach the Cloudflare API, run:
npx wrangler whoamiyarn wrangler whoamipnpm wrangler whoamiDo not set NODE_TLS_REJECT_UNAUTHORIZED=0 to work around this error. It disables certificate verification entirely.
- Commands - A detailed list of the commands that Wrangler supports.
- Configuration - Learn more about Wrangler's configuration file.