Common Issues & Solutions

Issue 1: "GEMINI_API_KEY not found in .env file"

Problem: When running the menu option 6 (Check Opportunities) or any Gemini-related command, you get:

Error: GEMINI_API_KEY not found in .env file

Why This Happens:

Solution:Already Fixed!

The scripts have been updated to automatically load the .env file from the parent directory. Just restart the PowerShell menu and try again.

To Verify the Fix:

  1. From the PowerShell menu, press E (Test Environment Variables)
  2. You should see all your environment variables listed with ✅ checkmarks
  3. If all are present, you're good to go!

If Still Not Working:

Run this test manually:

cd C:\dev\itblogpros\_automation
node test-env.js

This will show you exactly which variables are loading and which aren't.


Issue 2: "opportunities-latest.json not found"

Problem: When trying to check opportunities, you get a file not found error.

Solution:

  1. From the PowerShell menu, press 9 (Run Bing Analysis)
  2. Wait 20-30 seconds for it to complete
  3. This creates the opportunities-latest.json file
  4. Now try option 6 again

Issue 3: Menu Option Does Nothing

Problem: You select a menu option but nothing happens or you get an error.

Solution:

Method 1 - Run Commands Directly:

# From _automation directory
cd C:\dev\itblogpros\_automation

# Test environment
node test-env.js

# Check opportunities
node integrated-system.js opportunities

# Generate article
node integrated-system.js test

Method 2 - Use the Batch Menu Instead:

cd C:\dev\itblogpros\_automation
START-HERE.bat

Method 3 - Check Requirements:

  1. Node.js installed: node --version (should show v14+)
  2. Dependencies installed: npm install (from parent directory)
  3. .env file exists: Check C:\dev\itblogpros\.env

Issue 4: "Module not found: @google/generative-ai"

Problem: Error about missing Google Generative AI package.

Solution:

cd C:\dev\itblogpros
npm install @google/generative-ai

Then restart the menu and try again.


Issue 5: Generated Article is Too Short/Long

Problem: Article doesn't meet the 1200-1500 word target.

Why This Happens:

Solution:

The system automatically checks word count and gives scores:

To Regenerate:

node integrated-system.js test

The system will keep trying until it gets a good article. Articles under 1200 words won't be auto-submitted to Bing.


Issue 6: Articles Not Auto-Submitting to Bing

Problem: Articles generate successfully but don't submit to Bing IndexNow.

Why This Happens: Articles need a quality score of 80+ to auto-submit. Check these requirements:

Quality Score Breakdown (100 points total):

Solution: Review the article tracking file to see your scores:

cd C:\dev\itblogpros\_automation
node -e "console.log(require('./article-tracking.json'))"

Articles with 80+ quality score will show submittedToBing: true


Issue 7: PowerShell Script Won't Run

Problem: Double-clicking START-HERE.ps1 doesn't work or shows security warning.

Solution:

Option 1 - Run from PowerShell:

cd C:\dev\itblogpros\_automation
.\START-HERE.ps1

Option 2 - Change Execution Policy (One-time):

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

Then run the script again.

Option 3 - Right-click the file: Right-click START-HERE.ps1Run with PowerShell


Issue 8: npm install Fails

Problem: npm install shows errors or fails to complete.

Solution:

Try these in order:

  1. Clear npm cache:
npm cache clean --force
  1. Delete node_modules and reinstall:
cd C:\dev\itblogpros
rmdir /s /q node_modules
npm install
  1. Update npm:
npm install -g npm@latest
  1. Check Node.js version:
node --version

Should be v14 or higher. If not, update Node.js from nodejs.org


Getting Help

Quick Diagnostic: From the PowerShell menu, press E to test environment variables. This will tell you exactly what's working and what's not.

Still Stuck?

  1. Run the full verification:
cd C:\dev\itblogpros
node verify-integration.js
  1. Check the logs: Look in _automation/article-tracking.json for error messages

  2. Test manually:

cd C:\dev\itblogpros\_automation
node test-env.js
node integrated-system.js opportunities

Each command will give you specific error messages that you can use to diagnose the problem.


Quick Reference - What Each File Does

File Purpose
.env Stores all your API keys and configuration
gemini-article-generator.js Generates articles using Gemini AI
integrated-system.js Orchestrates the full workflow
test-env.js Tests if environment variables are loading
opportunities-latest.json Bing search data (generated by option 9)
latest.json SEO health data (generated by option 0)
article-tracking.json History of generated articles

Pro Tips

  1. Always run option E first when you start the menu - it will catch any environment issues immediately

  2. Run option 9 weekly to keep Bing opportunities fresh

  3. Check tracking after each article:

node -e "const t = require('./article-tracking.json'); console.log(t[t.length-1])"

This shows your most recent article's scores

  1. Batch generate during off-hours to save time

  2. Target quality score 85+ for best SEO results


Last Updated: Based on fixes applied to resolve .env loading issues