Prerequisites
Before installing Mastra, ensure you have the following:- Node.js version 22.13.0 or higher
- A package manager: npm, pnpm, or yarn
Mastra requires Node.js >= 22.13.0 to take advantage of the latest TypeScript and JavaScript features.
Quick Start with CLI (Recommended)
The fastest way to get started with Mastra is using the create command:Run the create command
Open your terminal and run:This interactive CLI will guide you through the setup process.
Follow the prompts
The CLI will ask you to:
- Choose a project name
- Select a template (starter, agent, workflow, etc.)
- Choose your preferred package manager
- Configure optional features
Start developing
You’re ready to build! Check out the Quickstart guide to create your first agent.
Manual Installation
If you prefer to add Mastra to an existing project:Verify Installation
Create a simple test file to verify your installation:test.ts
Next Steps
Quickstart
Build your first AI agent in minutes
Core Concepts
Learn the fundamentals of Mastra
Troubleshooting
Node.js version error
Node.js version error
Make sure you’re using Node.js version 22.13.0 or higher:If needed, update Node.js using nvm or download from nodejs.org.
Module not found errors
Module not found errors
Ensure all peer dependencies are installed, especially
zod: