Files
create-better-t-stack/apps/web/content/docs/installation.mdx
2025-07-20 22:38:59 +05:30

237 lines
4.8 KiB
Plaintext

---
title: Installation
description: How to install and set up Better-T-Stack CLI
---
## System Requirements
Before installing Better-T-Stack, ensure your system meets these requirements:
- **Node.js**: Version 18 or higher
- **Package Manager**: npm, pnpm, or bun
- **Git**: For repository initialization (optional but recommended)
### Optional Dependencies
Depending on your project configuration, you may need:
- **Docker**: For local database development with Docker Compose
- **Rust & System Dependencies**: For Tauri desktop applications
- **Cloudflare CLI**: For Workers deployment
## Quick Start (Recommended)
The fastest way to get started is using npx, which runs the latest version without installation:
```bash
npx create-better-t-stack@latest my-project
```
This command will:
1. Download the latest version of the CLI
2. Run the interactive setup wizard
3. Create your project in the `my-project` directory
## Package Manager Specific Commands
### npm
```bash
# Run without installing
npx create-better-t-stack@latest my-project
# Or install globally
npm install -g create-better-t-stack
create-better-t-stack my-project
```
### pnpm
```bash
# Run without installing (recommended)
pnpm create better-t-stack@latest my-project
# Or install globally
pnpm add -g create-better-t-stack
create-better-t-stack my-project
```
### bun
```bash
# Run without installing (recommended)
bun create better-t-stack@latest my-project
# Or install globally
bun add -g create-better-t-stack
create-better-t-stack my-project
```
## Global Installation
If you frequently create new projects, you might want to install the CLI globally:
<Tabs items={['npm', 'pnpm', 'bun']}>
<Tab value="npm">
```bash
npm install -g create-better-t-stack
```
</Tab>
<Tab value="pnpm">
```bash
pnpm add -g create-better-t-stack
```
</Tab>
<Tab value="bun">
```bash
bun add -g create-better-t-stack
```
</Tab>
</Tabs>
After global installation, you can run:
```bash
create-better-t-stack my-project
```
## Verification
Verify your installation by checking the version:
```bash
# If installed globally
create-better-t-stack --version
# Or with npx
npx create-better-t-stack@latest --version
```
You should see output similar to:
```
2.26.3
```
## Development Installation
For contributing to Better-T-Stack or running the latest development version:
```bash
# Clone the repository
git clone https://github.com/AmanVarshney01/create-better-t-stack.git
cd create-better-t-stack
# Install dependencies
pnpm install
# Build the CLI
cd apps/cli
pnpm build
# Link for local development
pnpm link --global
```
## Troubleshooting
### Common Issues
#### Permission Errors (npm)
If you encounter permission errors with npm global installation:
```bash
# Use npx instead (recommended)
npx create-better-t-stack@latest my-project
# Or configure npm to use a different directory
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
```
#### Node.js Version Issues
Ensure you're using Node.js 18 or higher:
```bash
node --version
```
If you need to upgrade Node.js:
- **Using nvm**: `nvm install 18 && nvm use 18`
- **Using n**: `n 18`
- **Download**: Visit [nodejs.org](https://nodejs.org/)
#### Package Manager Not Found
If you prefer a specific package manager but it's not installed:
```bash
# Install pnpm
npm install -g pnpm
# Install bun
curl -fsSL https://bun.sh/install | bash
```
#### Network Issues
If you experience network timeouts or connection issues:
```bash
# Try with different registry
npm config set registry https://registry.npmjs.org/
# Or clear npm cache
npm cache clean --force
```
## Next Steps
Once installed, you're ready to create your first project:
1. **Quick Start**: Follow our [Quick Start Guide](/docs/quick-start)
2. **Configuration**: Learn about [Configuration Options](/docs/frontend)
3. **CLI Reference**: Explore all [CLI Commands](/docs/cli-commands)
## Staying Updated
To ensure you're always using the latest version with bug fixes and new features:
### Using npx (Automatic)
When using `npx create-better-t-stack@latest`, you automatically get the latest version.
### Global Installation Updates
If you have it installed globally, update regularly:
<Tabs items={['npm', 'pnpm', 'bun']}>
<Tab value="npm">
```bash
npm update -g create-better-t-stack
```
</Tab>
<Tab value="pnpm">
```bash
pnpm update -g create-better-t-stack
```
</Tab>
<Tab value="bun">
```bash
bun update -g create-better-t-stack
```
</Tab>
</Tabs>
### Release Notes
Stay informed about new features and changes:
- **GitHub Releases**: [View releases](https://github.com/AmanVarshney01/create-better-t-stack/releases)
- **Changelog**: Check the repository for detailed changes
- **Breaking Changes**: Major version updates may include breaking changes