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:
.env file is in C:\dev\itblogpros\.envC:\dev\itblogpros\_automation\.env fileSolution: ✅ 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:
E (Test Environment Variables)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.
Problem: When trying to check opportunities, you get a file not found error.
Solution:
9 (Run Bing Analysis)opportunities-latest.json fileProblem: 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:
node --version (should show v14+)npm install (from parent directory).env file exists: Check C:\dev\itblogpros\.envProblem: Error about missing Google Generative AI package.
Solution:
cd C:\dev\itblogpros
npm install @google/generative-ai
Then restart the menu and try again.
Problem: Article doesn't meet the 1200-1500 word target.
Why This Happens:
Solution:
The system automatically checks word count and gives scores:
1600 words: Review manually, may need editing
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.
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
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.ps1 → Run with PowerShell
Problem: npm install shows errors or fails to complete.
Solution:
Try these in order:
npm cache clean --force
cd C:\dev\itblogpros
rmdir /s /q node_modules
npm install
npm install -g npm@latest
node --version
Should be v14 or higher. If not, update Node.js from nodejs.org
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?
cd C:\dev\itblogpros
node verify-integration.js
Check the logs:
Look in _automation/article-tracking.json for error messages
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.
| 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 |
Always run option E first when you start the menu - it will catch any environment issues immediately
Run option 9 weekly to keep Bing opportunities fresh
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
Batch generate during off-hours to save time
Target quality score 85+ for best SEO results
Last Updated: Based on fixes applied to resolve .env loading issues