Frequently Asked Questions
Quick answers to common questions about PCU. Can't find what you're looking for? Check our troubleshooting guide or open an issue.
Installation & Setup
How do I install PCU?
PCU can be installed globally via npm, pnpm, or yarn:
npm install -g pcu
What are the system requirements?
- Node.js: >= 18.0.0 (LTS recommended)
- pnpm: >= 8.0.0
- Operating System: Windows, macOS, Linux
Do I need a pnpm workspace to use PCU?
Yes, PCU is specifically designed for pnpm workspaces with catalog dependencies. If you don't have a workspace yet, run pcu init to create one.
Can I use PCU with npm or yarn projects?
No, PCU is exclusively for pnpm workspaces using catalog dependencies. For other package managers, consider tools like npm-check-updates or yarn upgrade-interactive.
Configuration
Where should I place my .pcurc.json configuration?
Place it in your workspace root directory (same level as pnpm-workspace.yaml). PCU also supports:
- Global configuration:
~/.pcurc.json - Project configuration:
./.pcurc.json(highest priority)
What's the difference between workspace-level and global configuration?
- Global (
~/.pcurc.json): Applied to all PCU operations across different projects - Project (
./.pcurc.json): Specific to the current workspace, overrides global settings
Can I configure different update strategies for different packages?
Yes! Use package rules in your configuration:
{
"packageRules": [
{
"patterns": ["react", "react-dom"],
"target": "minor",
"requireConfirmation": true
},
{
"patterns": ["@types/*"],
"target": "latest",
"autoUpdate": true
}
]
}
Commands & Usage
What's the difference between pcu check and pcu -c?
They're identical! PCU supports both full command names and short aliases:
pcu check=pcu -cpcu update=pcu -upcu interactive=pcu -i
How do I update only specific types of packages?
Use the --include and --exclude flags:
# Only update React-related packages
pcu update --include "react*"
# Update everything except major framework changes
pcu update --exclude "react*,vue*,angular*"
# Only update type definitions
pcu update --include "@types/*"
What's the difference between update targets?
patch: Bug fixes only (1.0.0 → 1.0.1)minor: New features, backward compatible (1.0.0 → 1.1.0)latest: Latest stable version including major changes (1.0.0 → 2.0.0)greatest: Latest version including prereleases (1.0.0 → 2.0.0-beta.1)
How do I check what will be updated before actually updating?
Use the --dry-run flag:
pcu update --dry-run --target minor
This shows you exactly what would be updated without making any changes.
Troubleshooting
Why does PCU say "No pnpm workspace found"?
This means PCU can't find a pnpm-workspace.yaml file in your current directory. Solutions:
- Create a workspace: Run
pcu init - Navigate to workspace root:
cdto the directory containingpnpm-workspace.yaml - Specify workspace path:
pcu -c --workspace /path/to/workspace
Why does PCU say "No catalog dependencies found"?
Your workspace doesn't use catalog dependencies yet. You need:
-
Catalog in workspace file:
# pnpm-workspace.yaml packages: - 'packages/*' catalog: react: ^18.2.0 typescript: ^5.0.0 -
Use catalogs in packages:
{ "dependencies": { "react": "catalog:", "typescript": "catalog:" } }
PCU is running very slowly. How can I improve performance?
Try these optimizations:
- Reduce concurrency:
pcu check --concurrency 2 - Increase timeout:
pcu check --timeout 60000 - Enable caching: Ensure
PCU_CACHE_ENABLED=true(default) - Use filtering:
pcu check --include "react*"for specific packages
How do I fix "ENOTFOUND registry.npmjs.org" errors?
This is a network connectivity issue:
- Check internet connection:
ping registry.npmjs.org - Configure proxy: Set
HTTP_PROXYandHTTPS_PROXYenvironment variables - Use corporate registry: Configure
.npmrcwith your company's registry - Increase timeout:
PCU_TIMEOUT=120000 pcu check
Security
How does PCU handle security vulnerabilities?
PCU integrates with npm audit and optionally Snyk:
# Check for vulnerabilities
pcu security
# Auto-fix security issues
pcu security --fix-vulns
# Include Snyk scanning
pcu security --snyk --severity high
Should I auto-fix all security vulnerabilities?
Use caution with --auto-fix:
- ✅ Safe: Patch and minor updates for security fixes
- ⚠️ Review: Major version updates that might break your app
- ❌ Avoid: Blindly auto-fixing in production without testing
How do I handle false positive security warnings?
Configure ignored vulnerabilities in .pcurc.json:
{
"security": {
"ignoredVulnerabilities": ["CVE-2021-23337"],
"ignoredPackages": ["lodash@4.17.20"],
"customAuditConfig": {
"low": "ignore",
"moderate": "warn"
}
}
}
Workflows & CI/CD
Can I use PCU in CI/CD pipelines?
Absolutely! PCU is designed for automation:
# CI-friendly commands
PCU_NO_COLOR=true pcu check --format json
pcu security --format json --severity critical
See our CI/CD integration guide for complete examples.
How do I create automated dependency update PRs?
Use PCU with GitHub Actions, GitLab CI, or other platforms:
- name: Update dependencies
run: |
pcu update --target minor --create-backup
# Create PR with changes
Check the CI/CD integration guide for full workflows.
What's the best workflow for team collaboration?
- Shared configuration: Commit
.pcurc.jsonto version control - Regular reviews: Schedule weekly dependency review meetings
- Security first: Always prioritize security updates
- Incremental updates: Prefer smaller, frequent updates over big batch updates
- Testing: Always test after updates before merging
Advanced Usage
Can I use multiple catalogs in one workspace?
Yes! PNPM supports multiple catalogs:
# pnpm-workspace.yaml
packages:
- 'packages/*'
catalog:
react: ^18.2.0
catalogs:
react17:
react: ^17.0.2
experimental:
react: ^19.0.0-beta
Then use them in packages:
{
"dependencies": {
"react": "catalog:react17"
}
}
How do I analyze the impact of updating a specific package?
Use the analyze command:
# Analyze impact of updating React
pcu analyze default react 18.3.0
# Check all catalogs
pcu analyze react17 react 17.0.3
Can I exclude certain packages from updates permanently?
Yes, configure exclusions in .pcurc.json:
{
"exclude": ["react", "vue", "@types/node"],
"packageRules": [
{
"patterns": ["critical-*"],
"exclude": true
}
]
}
How do I handle monorepos with 100+ packages?
Performance tips for large monorepos:
- Batch processing: Configure
batchSize: 10in advanced settings - Reduce concurrency: Set
concurrency: 2to avoid overwhelming the registry - Use filtering: Process packages in groups with
--includepatterns - Enable caching: Ensure caching is enabled and properly configured
- Increase memory: Set
NODE_OPTIONS="--max-old-space-size=8192"
Error Messages
"Cannot resolve peer dependencies"
This happens when package versions conflict. Solutions:
- Update related packages together:
pcu update --include "react*" - Use interactive mode:
pcu update --interactiveto choose versions carefully - Check peer dependencies: Review what each package requires
- Use multiple catalogs: Separate conflicting versions into different catalogs
"Invalid configuration in .pcurc.json"
Your configuration file has JSON syntax errors:
# Validate JSON syntax
node -e "JSON.parse(require('fs').readFileSync('.pcurc.json', 'utf8'))"
# Regenerate config if needed
mv .pcurc.json .pcurc.json.backup
pcu init --force
"Command not found: pcu"
Installation or PATH issues:
- Reinstall globally:
npm install -g pcu - Check PATH: Ensure npm global bin is in your PATH
- Use npx:
npx pnpm-catalog-updates checkas alternative - Use pnpm:
pnpm add -g pnpm-catalog-updates(recommended)
Integration & Tools
Does PCU work with Renovate or Dependabot?
PCU is an alternative to these tools, not a complement:
- PCU: Manual control, pnpm-specific, catalog-focused
- Renovate: Automated PRs, supports many package managers
- Dependabot: GitHub-integrated, automated security updates
Choose based on your workflow preferences. For migration, see our migration guide.
Can I integrate PCU with my IDE?
While there's no official IDE extension, you can:
- Add npm scripts: Configure commands in
package.json - Use task runners: Integrate with VS Code tasks or similar
- Terminal integration: Most IDEs support terminal integration
Does PCU support private npm registries?
Yes! PCU reads your .npmrc configuration:
# .npmrc
@mycompany:registry=https://npm.company.com/
//npm.company.com/:_authToken=${NPM_TOKEN}
PCU will automatically use the correct registry for each package scope.
Still Have Questions?
- 📖 Documentation: Check our comprehensive command reference
- 🛠️ Troubleshooting: Visit our troubleshooting guide
- 🐛 Bug Reports: Create an issue
- 💬 Discussions: GitHub Discussions