Prerequisites
Before installing the Workers SDK, ensure your system meets these requirements:Node.js
Required: Node.js 20.0.0 or higherCheck your version:
node --versionPackage Manager
npm, pnpm, or yarnRecommended: pnpm for faster installs
Operating System Support
Wrangler is supported on:
- macOS: 13.5 or later
- Windows: Windows 11
- Linux: Distributions with glibc 2.35 or later
Installation Methods
There are several ways to install and use the Workers SDK depending on your workflow.Method 1: Create a New Project (Recommended)
The fastest way to get started is using Create Cloudflare (C3), which scaffolds a complete project:Run the create command
create-cloudflare and runs the interactive setup wizard.Follow the prompts
C3 will guide you through:
- Project name and directory
- Template selection (Hello World, frameworks, etc.)
- TypeScript or JavaScript
- Git initialization
- Deployment option
Method 2: Install Wrangler Globally
Install Wrangler globally to use it across multiple projects:Method 3: Install as Project Dependency
Add Wrangler to an existing project:Method 4: Use npx (No Installation)
Run Wrangler commands without installing:npx downloads and runs the latest version each time. This ensures you always have the newest version but may be slower.
Installing Additional Packages
Depending on your use case, you may want to install additional Workers SDK packages:Miniflare (Local Development Runtime)
Miniflare is included with Wrangler but can be used standalone:4.20260305.0
Using Miniflare Programmatically
Using Miniflare Programmatically
Workers Types (TypeScript Support)
Add TypeScript definitions for the Workers runtime:tsconfig.json:
tsconfig.json
Vitest Pool Workers (Testing)
For testing Workers with Vitest in the actual runtime:vitest.config.js:
vitest.config.js
Configuration
After installation, configure your Worker with awrangler.jsonc, wrangler.json, or wrangler.toml file:
Authentication
Before deploying Workers, authenticate with Cloudflare:Using API Tokens
Using API Tokens
For CI/CD environments, use API tokens instead:
- Create an API token at dash.cloudflare.com/profile/api-tokens
- Use the “Edit Cloudflare Workers” template
- Set the
CLOUDFLARE_API_TOKENenvironment variable:
Using Account ID and API Key
Using Account ID and API Key
Legacy authentication (not recommended):
Version Management
Checking Versions
Check installed package versions:Updating Packages
Keep your Workers SDK packages up to date:Beta Releases
Install beta releases from the main branch:wrangler@maincreate-cloudflare@mainminiflare@main@cloudflare/vitest-pool-workers@main
Workspace Setup (Monorepo)
For monorepo setups using pnpm workspaces:pnpm-workspace.yaml
wrangler.jsonc configuration.
Troubleshooting
Node.js version too old
Node.js version too old
Error:
This version of Wrangler requires at least Node.js v20.0.0Solution: Update Node.js using nvm or download from nodejs.orgEACCES permission errors
EACCES permission errors
Permission errors when installing globally:Solution: Use a Node version manager (nvm) or install in a project directory instead of globally.
Module resolution errors
Module resolution errors
Cannot find module
wrangler:Solution: Ensure you’re in the correct directory and dependencies are installed:Platform-specific issues
Platform-specific issues
Windows: Make sure you’re using Windows 11. Windows 10 is not supported.Linux: Verify glibc version:You need glibc 2.35 or higher.
Next Steps
Now that you have the Workers SDK installed:Create Your First Worker
Follow the quickstart guide to build and deploy
Configure Your Worker
Learn about configuration options
Set Up Testing
Configure Vitest for Workers testing
For detailed documentation on all configuration options, see the official Wrangler documentation.