This guide covers common issues you might encounter when using Gleef CLI and provides step-by-step solutions to resolve them.
Installation Issues
Node.js Version Compatibility
Error:
npm ERR! engine Unsupported engine
npm ERR! Required: node >=18.0.0
npm ERR! Actual: v16.14.0
Solution:
- Check current version:
node --version
- Update Node.js: Download latest from nodejs.org
- Or use nvm:
# Install nvm (if not installed)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Install and use Node.js 18+
nvm install 18
nvm use 18
Permission Errors
Error:
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/@gleef
Solution (macOS/Linux):
# Option 1: Use sudo (not recommended)
sudo npm install -g @gleef/cli
# Option 2: Configure npm to use user directory (recommended)
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.profile
source ~/.profile
npm install -g @gleef/cli
Solution (Windows):
- Run Command Prompt as Administrator
- Install the CLI:
npm install -g @gleef/cli
Network/Firewall Issues
Error:
npm ERR! network request to https://registry.npmjs.org/@gleef%2fcli failed
Solution:
- Check internet connection
- Configure corporate proxy:
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
- Use different registry:
npm install -g @gleef/cli --registry https://registry.yarnpkg.com
Authentication Issues
Invalid API Key
Error:
The given API key doesn't seem to be valid. Please check your key and try again.
Solution:
- Verify key format: API keys start with
gl_
followed by alphanumeric characters
- Check for extra characters: Remove any spaces or newlines from the key
- Generate new key: Visit https://app.gleef.eu/settings/api-keys
- Re-authenticate:
gleef login --key YOUR_NEW_API_KEY
Authentication Storage Issues
Error:
Error: Could not save API key to configuration file
Solution (macOS/Linux):
# Check permissions on config directory
ls -la ~/.config/gleef/
# Fix permissions if needed
mkdir -p ~/.config/gleef
chmod 755 ~/.config/gleef
Solution (Windows):
# Check if directory exists
dir %APPDATA%\gleef
# Create if missing
mkdir %APPDATA%\gleef
Network Authentication Issues
Error:
Error: Network request failed - getaddrinfo ENOTFOUND api.gleef.eu
Solution:
- Check DNS:
nslookup api.gleef.eu
- Try different DNS:
# Use Google DNS
export DNS_SERVER=8.8.8.8
- Corporate firewall: Contact IT to whitelist
*.gleef.eu
- VPN issues: Try without VPN or with different VPN server
Configuration Issues
No Files Detected During Init
Error:
⚠ No locale files found in your project
Solutions:
-
Check file extensions:
# Verify you have supported files
find . -name "*.json" -o -name "*.xml" -o -name "*.yaml" -o -name "*.strings"
-
Check .gitignore exclusions:
# See what files are being ignored
git check-ignore -v src/locales/*.json
-
Manual configuration:
{
"localeFilePatterns": [
"path/to/your/locale/files/*.json"
]
}
Invalid Configuration File
Error:
Error: Invalid configuration file at .gleef/config.json
Solution:
- Validate JSON syntax:
cat .gleef/config.json | jq empty
- Common JSON errors:
- Missing quotes around keys
- Trailing commas
- Unclosed brackets/braces
- Reset configuration:
rm -rf .gleef/
gleef init
Pattern Matching Issues
Error:
Warning: Pattern 'src/**.json' matched no files
Solution:
- Fix pattern syntax:
{
"localeFilePatterns": [
"src/**/*.json"
]
}
- Test patterns:
# Test with shell
ls src/**/*.json
# Test with find
find . -path "src/**/*.json"
Command Execution Issues
”Nothing to translate” When Expecting Changes
Issue: Running gleef translate
shows no changes despite having new keys.
Solutions:
-
Check if files have actual changes:
-
Verify configuration patterns or run:
-
Check for conflicts:
-
Reset and retry:
gleef pull
gleef translate
Pull Command Not Updating Files
Issue: gleef pull
claims to update files but no changes appear locally.
Solutions:
-
Check file permissions:
ls -la src/locales/
chmod 644 src/locales/*.json
-
Verify files match patterns:
-
Check if translations are approved in Gleef Studio
-
Force full sync:
-
Remove
.gleef/lock.json
Conflict Resolution Issues
Error:
Conflict with remotely edited translations. Update keys with the remote value, or change them from the webapp.
Solutions:
-
Accept remote changes:
gleef pull # Get remote version
gleef translate # Push remaining changes
-
Keep local changes:
- Update the conflicting key in Gleef Studio to match your local version
- Run
gleef translate
again
-
Manual resolution:
- Decide on the correct value
- Update both locally and in Gleef Studio
- Run
gleef translate
JSON Syntax Errors
Error:
Couldn't generate and push translations: Invalid JSON in locale file
Solution:
-
Find the problematic file:
# Check each JSON file
for file in src/locales/*.json; do
echo "Checking $file"
cat "$file" | jq empty || echo "Error in $file"
done
-
Common JSON issues:
- Trailing commas:
{"key": "value",}
→ {"key": "value"}
- Unescaped quotes:
"He said "hello""
→ "He said \"hello\""
- Missing commas:
{"a": "b" "c": "d"}
→ {"a": "b", "c": "d"}
-
Fix with automated tools:
# Use jq to format properly
jq . src/locales/en.json > temp.json && mv temp.json src/locales/en.json
Error:
Error parsing XML file: src/locales/strings.xml
Solution:
-
Validate XML:
xmllint --noout src/locales/strings.xml
-
Common XML issues:
- Unclosed tags:
<string name="key">value
→ <string name="key">value</string>
- Invalid characters:
&
→ &
, <
→ <
, >
→ >
- Missing declarations: Add
<?xml version="1.0" encoding="UTF-8"?>
Error:
Error parsing YAML file: Invalid YAML syntax
Solution:
-
Validate YAML:
yq empty src/locales/en.yml
-
Common YAML issues:
- Indentation: Use consistent spaces (not tabs)
- Missing quotes:
key: value with: colon
→ key: "value with: colon"
- List formatting: Ensure proper
-
spacing
Slow Translation Processing
Issue: gleef translate
takes very long to complete.
Solutions:
-
Use pattern matching:
# Process specific keys only
gleef translate --match "component.*"
-
Check file sizes:
# Find large files that might slow processing
find src/locales -name "*.json" -exec wc -l {} + | sort -n
-
Optimize patterns:
{
"localeFilePatterns": [
"src/locales/*.json",
"!**/*test*.json",
"!**/node_modules/**"
]
}
High Memory Usage
Issue: CLI uses excessive memory during processing.
Solutions:
-
Process files in batches:
gleef translate --match "auth.*"
gleef translate --match "nav.*"
-
Reduce file sizes: Split large translation files into smaller ones
-
Close other applications: Free up system memory
Recovery Procedures
Complete Reset
If you encounter persistent issues, try a complete reset:
# 1. Backup your files
cp -r src/locales src/locales.backup
# 2. Remove configuration
rm -rf .gleef/
# 3. Clear authentication
rm -rf ~/.config/gleef # macOS/Linux
# or
rmdir /s %APPDATA%\gleef # Windows
# 4. Reinstall CLI
npm uninstall -g @gleef/cli
npm install -g @gleef/cli
# 5. Re-authenticate and initialize
gleef login
gleef init
# 6. Pull all translations
gleef pull --all
# 7. Restore files if needed
cp -r src/locales.backup/* src/locales/
Configuration Recovery
If your configuration is corrupted:
# 1. Backup current config
cp .gleef/config.json .gleef/config.json.backup
# 2. Regenerate configuration
rm .gleef/config.json
gleef init
# 3. Manually merge any custom settings from backup
File Recovery
If translation files are corrupted:
# 1. Check git history
git log --oneline src/locales/
# 2. Restore from git
git checkout HEAD~1 -- src/locales/
# 3. Or pull fresh from Gleef
gleef pull --all
Getting Help
When reporting issues, include this diagnostic info:
# System information
gleef --version
node --version
npm --version
# Configuration
cat .gleef/config.json
# File patterns test
gleef init
# Network test
curl -I https://api.gleef.eu/
Log Files
Enable verbose logging for debugging:
gleef translate 2>&1 | tee gleef.log
Contact Gleef to enable verbose/debug mode.
Support Channels
Next Steps