# Installation Guide
This guide will walk you through installing PinMe on your system. PinMe is available as a Node.js package and can be installed using npm or yarn.

## Prerequisites

### System Requirements
- **Operating System**: Windows, macOS, or Linux
- **Node.js**: Version 16.0 or higher
- **Internet Connection**: Required for IPFS upload and gateway access

### Install Node.js

If you don't have Node.js installed, download it from the official website:

**[https://nodejs.org/](https://nodejs.org/)**

We recommend using the LTS (Long Term Support) version for best stability.

#### Verify Node.js Installation
```bash
node --version
# Should output: v16.0.0 or higher

npm --version
# Should output: 8.0.0 or higher
```

## Installation Methods

### Method 1: Using npm (Recommended)

```bash
npm install -g pinme
```

This installs PinMe globally on your system, making the `pinme` command available everywhere.

### Method 2: Using yarn

If you prefer yarn as your package manager:

```bash
yarn global add pinme
```

## Verification

After installation, verify that PinMe is correctly installed:

### Check Version
```bash
pinme --version
```

### View Help
```bash
pinme help
```

If you see the help output without errors, PinMe is successfully installed!

## Troubleshooting

### Permission Denied (Linux/macOS)

If you get a permission error during installation:

```bash
sudo npm install -g pinme
```

Or use a Node version manager like [nvm](https://github.com/nvm-sh/nvm):

```bash
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

# Install and use latest Node.js
nvm install node
nvm use node

# Install PinMe
npm install -g pinme
```

### Command Not Found

If `pinme` command is not found after installation:

1. **Check npm global path**:
   ```bash
   npm config get prefix
   ```

2. **Add to PATH** (if needed):
   ```bash
   # For bash
   echo 'export PATH=$(npm config get prefix)/bin:$PATH' >> ~/.bashrc
   source ~/.bashrc
   
   # For zsh
   echo 'export PATH=$(npm config get prefix)/bin:$PATH' >> ~/.zshrc
   source ~/.zshrc
   ```

3. **Restart your terminal** or run `source ~/.bashrc` (or `~/.zshrc`)

### Windows-Specific Issues

#### Using PowerShell on Windows
If you're using PowerShell and get execution policy errors:

```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```

#### Windows PATH Issues
1. Open "Environment Variables" from System Properties
2. Find "Path" in user variables
3. Add: `%APPDATA%\npm`

## Update PinMe

To update to the latest version:

```bash
npm update -g pinme
```

Or with yarn:
```bash
yarn global upgrade pinme
```

## Uninstall PinMe

If you need to remove PinMe:

```bash
npm uninstall -g pinme
```

Or with yarn:
```bash
yarn global remove pinme
```
