[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-eee333c7-b73a-441d-a12e-603d87d0b881":3,"$fmC4PdsbvuZCysIiVVfz7wbhLFAItUYJcW-Th5nHfmQA":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"eee333c7-b73a-441d-a12e-603d87d0b881","environment-setup-guide","引导开发者使用适当的工具、依赖项和配置设置开发环境","cat_life_career","mod_other","sickn33,other","---\nname: environment-setup-guide\ndescription: \"Guide developers through setting up development environments with proper tools, dependencies, and configurations\"\nrisk: unknown\nsource: community\ndate_added: \"2026-02-27\"\n---\n\n\u003C!-- security-allowlist: curl-pipe-bash -->\n\n# Environment Setup Guide\n\n## Overview\n\nHelp developers set up complete development environments from scratch. This skill provides step-by-step guidance for installing tools, configuring dependencies, setting up environment variables, and verifying the setup works correctly.\n\n## When to Use This Skill\n\n- Use when starting a new project and need to set up the development environment\n- Use when onboarding new team members to a project\n- Use when switching to a new machine or operating system\n- Use when troubleshooting environment-related issues\n- Use when documenting setup instructions for a project\n- Use when creating development environment documentation\n\n## How It Works\n\n### Step 1: Identify Requirements\n\nI'll help you determine what needs to be installed:\n- Programming language and version (Node.js, Python, Go, etc.)\n- Package managers (npm, pip, cargo, etc.)\n- Database systems (PostgreSQL, MongoDB, Redis, etc.)\n- Development tools (Git, Docker, IDE extensions, etc.)\n- Environment variables and configuration files\n\n### Step 2: Check Current Setup\n\nBefore installing anything, I'll help you check what's already installed:\n```bash\n# Check versions of installed tools\nnode --version\npython --version\ngit --version\ndocker --version\n```\n\n### Step 3: Provide Installation Instructions\n\nI'll give platform-specific installation commands:\n- **macOS:** Using Homebrew\n- **Linux:** Using apt, yum, or package manager\n- **Windows:** Using Chocolatey, Scoop, or direct installers\n\n### Step 4: Configure the Environment\n\nHelp set up:\n- Environment variables (.env files)\n- Configuration files (.gitconfig, .npmrc, etc.)\n- IDE settings (VS Code, IntelliJ, etc.)\n- Shell configuration (.bashrc, .zshrc, etc.)\n\n### Step 5: Verify Installation\n\nProvide verification steps to ensure everything works:\n- Run version checks\n- Test basic commands\n- Verify database connections\n- Check environment variables are loaded\n\n## Examples\n\n### Example 1: Node.js Project Setup\n\n```markdown\n## Setting Up Node.js Development Environment\n\n### Prerequisites\n- macOS, Linux, or Windows\n- Terminal\u002FCommand Prompt access\n- Internet connection\n\n### Step 1: Install Node.js\n\n**macOS (using Homebrew):**\n\\`\\`\\`bash\n# Install Homebrew if not installed\n\u002Fbin\u002Fbash -c \"$(curl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002FHomebrew\u002Finstall\u002FHEAD\u002Finstall.sh)\"\n\n# Install Node.js\nbrew install node\n\\`\\`\\`\n\n**Linux (Ubuntu\u002FDebian):**\n\\`\\`\\`bash\n# Update package list\nsudo apt update\n\n# Install Node.js and npm\ncurl -fsSL https:\u002F\u002Fdeb.nodesource.com\u002Fsetup_20.x | sudo -E bash -\nsudo apt install -y nodejs\n\\`\\`\\`\n\n**Windows (using Chocolatey):**\n\\`\\`\\`powershell\n# Install Chocolatey if not installed\nSet-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https:\u002F\u002Fcommunity.chocolatey.org\u002Finstall.ps1'))\n\n# Install Node.js\nchoco install nodejs\n\\`\\`\\`\n\n### Step 2: Verify Installation\n\n\\`\\`\\`bash\nnode --version  # Should show v20.x.x or higher\nnpm --version   # Should show 10.x.x or higher\n\\`\\`\\`\n\n### Step 3: Install Project Dependencies\n\n\\`\\`\\`bash\n# Clone the repository\ngit clone https:\u002F\u002Fgithub.com\u002Fyour-repo\u002Fproject.git\ncd project\n\n# Install dependencies\nnpm install\n\\`\\`\\`\n\n### Step 4: Set Up Environment Variables\n\nCreate a \\`.env\\` file:\n\\`\\`\\`bash\n# Copy example environment file\ncp .env.example .env\n\n# Edit with your values\nnano .env\n\\`\\`\\`\n\nExample \\`.env\\` content:\n\\`\\`\\`\nNODE_ENV=development\nPORT=3000\nDATABASE_URL=postgresql:\u002F\u002Flocalhost:5432\u002Fmydb\nAPI_KEY=your-api-key-here\n\\`\\`\\`\n\n### Step 5: Run the Project\n\n\\`\\`\\`bash\n# Start development server\nnpm run dev\n\n# Should see: Server running on http:\u002F\u002Flocalhost:3000\n\\`\\`\\`\n\n### Troubleshooting\n\n**Problem:** \"node: command not found\"\n**Solution:** Restart your terminal or run \\`source ~\u002F.bashrc\\` (Linux) or \\`source ~\u002F.zshrc\\` (macOS)\n\n**Problem:** \"Permission denied\" errors\n**Solution:** Don't use sudo with npm. Fix permissions:\n\\`\\`\\`bash\nmkdir ~\u002F.npm-global\nnpm config set prefix '~\u002F.npm-global'\necho 'export PATH=~\u002F.npm-global\u002Fbin:$PATH' >> ~\u002F.bashrc\nsource ~\u002F.bashrc\n\\`\\`\\`\n```\n\n### Example 2: Python Project Setup\n\n```markdown\n## Setting Up Python Development Environment\n\n### Step 1: Install Python\n\n**macOS:**\n\\`\\`\\`bash\nbrew install python@3.11\n\\`\\`\\`\n\n**Linux:**\n\\`\\`\\`bash\nsudo apt update\nsudo apt install python3.11 python3.11-venv python3-pip\n\\`\\`\\`\n\n**Windows:**\n\\`\\`\\`powershell\nchoco install python --version=3.11\n\\`\\`\\`\n\n### Step 2: Verify Installation\n\n\\`\\`\\`bash\npython3 --version  # Should show Python 3.11.x\npip3 --version     # Should show pip 23.x.x\n\\`\\`\\`\n\n### Step 3: Create Virtual Environment\n\n\\`\\`\\`bash\n# Navigate to project directory\ncd my-project\n\n# Create virtual environment\npython3 -m venv venv\n\n# Activate virtual environment\n# macOS\u002FLinux:\nsource venv\u002Fbin\u002Factivate\n\n# Windows:\nvenv\\Scripts\\activate\n\\`\\`\\`\n\n### Step 4: Install Dependencies\n\n\\`\\`\\`bash\n# Install from requirements.txt\npip install -r requirements.txt\n\n# Or install packages individually\npip install flask sqlalchemy python-dotenv\n\\`\\`\\`\n\n### Step 5: Set Up Environment Variables\n\nCreate \\`.env\\` file:\n\\`\\`\\`\nFLASK_APP=app.py\nFLASK_ENV=development\nDATABASE_URL=sqlite:\u002F\u002F\u002Fapp.db\nSECRET_KEY=your-secret-key-here\n\\`\\`\\`\n\n### Step 6: Run the Application\n\n\\`\\`\\`bash\n# Run Flask app\nflask run\n\n# Should see: Running on http:\u002F\u002F127.0.0.1:5000\n\\`\\`\\`\n```\n\n### Example 3: Docker Development Environment\n\n```markdown\n## Setting Up Docker Development Environment\n\n### Step 1: Install Docker\n\n**macOS:**\n\\`\\`\\`bash\nbrew install --cask docker\n# Or download Docker Desktop from docker.com\n\\`\\`\\`\n\n**Linux:**\n\\`\\`\\`bash\n# Install Docker\ncurl -fsSL https:\u002F\u002Fget.docker.com -o get-docker.sh\nsudo sh get-docker.sh\n\n# Add user to docker group\nsudo usermod -aG docker $USER\nnewgrp docker\n\\`\\`\\`\n\n**Windows:**\nDownload Docker Desktop from docker.com\n\n### Step 2: Verify Installation\n\n\\`\\`\\`bash\ndocker --version        # Should show Docker version 24.x.x\ndocker-compose --version # Should show Docker Compose version 2.x.x\n\\`\\`\\`\n\n### Step 3: Create docker-compose.yml\n\n\\`\\`\\`yaml\nversion: '3.8'\n\nservices:\n  app:\n    build: .\n    ports:\n      - \"3000:3000\"\n    environment:\n      - NODE_ENV=development\n      - DATABASE_URL=postgresql:\u002F\u002Fpostgres:password@db:5432\u002Fmydb\n    volumes:\n      - .:\u002Fapp\n      - \u002Fapp\u002Fnode_modules\n    depends_on:\n      - db\n\n  db:\n    image: postgres:15\n    environment:\n      - POSTGRES_USER=postgres\n      - POSTGRES_PASSWORD=password\n      - POSTGRES_DB=mydb\n    ports:\n      - \"5432:5432\"\n    volumes:\n      - postgres_data:\u002Fvar\u002Flib\u002Fpostgresql\u002Fdata\n\nvolumes:\n  postgres_data:\n\\`\\`\\`\n\n### Step 4: Start Services\n\n\\`\\`\\`bash\n# Build and start containers\ndocker-compose up -d\n\n# View logs\ndocker-compose logs -f\n\n# Stop services\ndocker-compose down\n\\`\\`\\`\n\n### Step 5: Verify Services\n\n\\`\\`\\`bash\n# Check running containers\ndocker ps\n\n# Test database connection\ndocker-compose exec db psql -U postgres -d mydb\n\\`\\`\\`\n```\n\n## Best Practices\n\n### ✅ Do This\n\n- **Document Everything** - Write clear setup instructions\n- **Use Version Managers** - nvm for Node, pyenv for Python\n- **Create .env.example** - Show required environment variables\n- **Test on Clean System** - Verify instructions work from scratch\n- **Include Troubleshooting** - Document common issues and solutions\n- **Use Docker** - For consistent environments across machines\n- **Pin Versions** - Specify exact versions in package files\n- **Automate Setup** - Create setup scripts when possible\n- **Check Prerequisites** - List required tools before starting\n- **Provide Verification Steps** - Help users confirm setup works\n\n### ❌ Don't Do This\n\n- **Don't Assume Tools Installed** - Always check and provide install instructions\n- **Don't Skip Environment Variables** - Document all required variables\n- **Don't Use Sudo with npm** - Fix permissions instead\n- **Don't Forget Platform Differences** - Provide OS-specific instructions\n- **Don't Leave Out Verification** - Always include test steps\n- **Don't Use Global Installs** - Prefer local\u002Fvirtual environments\n- **Don't Ignore Errors** - Document how to handle common errors\n- **Don't Skip Database Setup** - Include database initialization steps\n\n## Common Pitfalls\n\n### Problem: \"Command not found\" after installation\n**Symptoms:** Installed tool but terminal doesn't recognize it\n**Solution:**\n- Restart terminal or source shell config\n- Check PATH environment variable\n- Verify installation location\n```bash\n# Check PATH\necho $PATH\n\n# Add to PATH (example)\nexport PATH=\"\u002Fusr\u002Flocal\u002Fbin:$PATH\"\n```\n\n### Problem: Permission errors with npm\u002Fpip\n**Symptoms:** \"EACCES\" or \"Permission denied\" errors\n**Solution:**\n- Don't use sudo\n- Fix npm permissions or use nvm\n- Use virtual environments for Python\n```bash\n# Fix npm permissions\nmkdir ~\u002F.npm-global\nnpm config set prefix '~\u002F.npm-global'\necho 'export PATH=~\u002F.npm-global\u002Fbin:$PATH' >> ~\u002F.bashrc\n```\n\n### Problem: Port already in use\n**Symptoms:** \"Port 3000 is already in use\"\n**Solution:**\n- Find and kill process using the port\n- Use a different port\n```bash\n# Find process on port 3000\nlsof -i :3000\n\n# Kill process\nkill -9 \u003CPID>\n\n# Or use different port\nPORT=3001 npm start\n```\n\n### Problem: Database connection fails\n**Symptoms:** \"Connection refused\" or \"Authentication failed\"\n**Solution:**\n- Verify database is running\n- Check connection string\n- Verify credentials\n```bash\n# Check if PostgreSQL is running\nsudo systemctl status postgresql\n\n# Test connection\npsql -h localhost -U postgres -d mydb\n```\n\n## Setup Script Template\n\nCreate a `setup.sh` script to automate setup:\n\n```bash\n#!\u002Fbin\u002Fbash\n\necho \"🚀 Setting up development environment...\"\n\n# Check prerequisites\ncommand -v node >\u002Fdev\u002Fnull 2>&1 || { echo \"❌ Node.js not installed\"; exit 1; }\ncommand -v git >\u002Fdev\u002Fnull 2>&1 || { echo \"❌ Git not installed\"; exit 1; }\n\necho \"✅ Prerequisites check passed\"\n\n# Install dependencies\necho \"📦 Installing dependencies...\"\nnpm install\n\n# Copy environment file\nif [ ! -f .env ]; then\n    echo \"📝 Creating .env file...\"\n    cp .env.example .env\n    echo \"⚠️  Please edit .env with your configuration\"\nfi\n\n# Run database migrations\necho \"🗄️  Running database migrations...\"\nnpm run migrate\n\n# Verify setup\necho \"🔍 Verifying setup...\"\nnpm run test:setup\n\necho \"✅ Setup complete! Run 'npm run dev' to start\"\n```\n\n## Related Skills\n\n- `@brainstorming` - Plan environment requirements before setup\n- `@systematic-debugging` - Debug environment issues\n- `@doc-coauthoring` - Create setup documentation\n- `@git-pushing` - Set up Git configuration\n\n## Additional Resources\n\n- [Node.js Installation Guide](https:\u002F\u002Fnodejs.org\u002Fen\u002Fdownload\u002F)\n- [Python Virtual Environments](https:\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002Fvenv.html)\n- [Docker Documentation](https:\u002F\u002Fdocs.docker.com\u002Fget-started\u002F)\n- [Homebrew (macOS)](https:\u002F\u002Fbrew.sh\u002F)\n- [Chocolatey (Windows)](https:\u002F\u002Fchocolatey.org\u002F)\n- [nvm (Node Version Manager)](https:\u002F\u002Fgithub.com\u002Fnvm-sh\u002Fnvm)\n- [pyenv (Python Version Manager)](https:\u002F\u002Fgithub.com\u002Fpyenv\u002Fpyenv)\n\n---\n\n**Pro Tip:** Create a `setup.sh` or `setup.ps1` script to automate the entire setup process. Test it on a clean system to ensure it works!\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,238,1302,"2026-05-16 13:16:51",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"其他","other","mdi-page-next-outline","其他类型Skill",5,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"职场发展","career","mdi-briefcase-outline","面试准备、简历优化、职业规划",4,575,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"a53c03c1-9c0a-479f-b50d-61dca3afc4ca","1.0.0","environment-setup-guide.zip",4494,"uploads\u002Fskills\u002Feee333c7-b73a-441d-a12e-603d87d0b881\u002Fenvironment-setup-guide.zip","38c2e44c509a8fb25258aa495bb5c87a3e7b1b10b331c44855a00f84f63094c7","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":11824}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]