Skip to main content
This guide covers common issues you might encounter with Better PM and how to resolve them.

Installation Issues

Symptoms:
Cause: Better PM is not installed or not in your PATH.Solution:
1

Install via Homebrew (recommended)

2

Or install via npm

Note: Homebrew is recommended as it installs a native binary with faster shell completions (~60ms vs 200-500ms).
3

Verify installation

Symptoms:
Cause: npm global binaries directory is not in your PATH.Solution:
1

Find npm global bin directory

2

Add to PATH

Add this to your ~/.zshrc or ~/.bashrc:
3

Reload shell

Package Manager Detection

Symptoms:
Cause: Better PM searches upward from your current directory for lockfiles but can’t find one. The search stops at your home directory or filesystem root.Diagnosis:Check if you have a lockfile in your project:
Solutions:
Generate one by running your package manager’s install command:
This creates the lockfile, after which Better PM will work.
Symptoms:
Cause: Multiple lockfiles exist in your project, and Better PM picks the first one it finds.Diagnosis:Check for multiple lockfiles:
Detection order (from src/pm/detect.ts:10-18):
  1. pnpm-lock.yaml → pnpm
  2. bun.lock → bun
  3. bun.lockb → bun
  4. package-lock.json → npm
Solution:Remove the unwanted lockfiles:

Workspace Detection

Symptoms:
Cause: Workspace configuration is missing or malformed.Diagnosis:
Check for pnpm-workspace.yaml:
Should contain:
Common issues:
  • File doesn’t exist: Create it with your package globs
  • Incorrect indentation: YAML is whitespace-sensitive
  • Missing quotes: Use quotes for globs with wildcards
Solution:Add or fix workspace configuration, then test:
Symptoms:
Cause: Package doesn’t match workspace glob patterns, or lacks a package.json.Diagnosis:
1

Check package.json exists

2

Check package has a name field

Better PM requires a name field (from src/commands/install.ts:23-24):
3

Verify glob pattern matches

If using packages/ui and packages/utils:
pnpm-workspace.yaml
Test the glob:

Shell Integration

Symptoms:
Cause: Shell integration not activated.Solution:
1

Add activation to shell config

2

Reload shell

3

Verify wrapper is loaded

See Shell Integration guide for details.
Symptoms:
Diagnosis:
1

Test completions directly

If this works, the issue is with shell completion setup.
2

Check shell integration

3

For zsh: check compinit order

In ~/.zshrc, ensure compinit runs after the activation:
Or use Oh My Zsh (which calls compinit automatically).
Symptoms: Typing pm cd <TAB> takes 2-3 seconds to show completions.Cause: Using npm installation instead of Homebrew.Explanation:From the README:
Homebrew is recommended — it installs a native binary, so shell completions resolve in ~60ms.
npm installation runs the CLI through Node.js, which is slower (200-500ms startup time).Solution:Switch to Homebrew installation:
Then reload shell and test:

Command Execution

Symptoms:
Expected behavior: Should show a warning and prompt for confirmation.Cause: Using -y / --sure flag, or running in non-interactive environment.Diagnosis:Check your command:
Check environment:
Solution:
  • To install specific packages: pm i -F @myapp/web
  • To install everything intentionally: pm i -y
  • For safety, always cd into a package before running pm i
Symptoms:
Common issues:
Cause: Pasted command has no package names.Solution: Include the package name:
Symptoms:
Cause: Package name doesn’t match any workspace package.Diagnosis:
1

List all packages

Check exact package names.
2

Check for typos

Package names are case-sensitive and must match exactly:
3

Check package.json name field

Use the exact name from package.json.

Performance Issues

Symptoms: Commands take 2-5 seconds to start.Diagnosis:
1

Check installation method

2

Benchmark startup time

Solution: Use Homebrew installation for better performance:
Symptoms: pm pls or pm cd takes several seconds in a monorepo with 100+ packages.Cause: Better PM enumerates all workspace packages by:
  1. Reading workspace globs from config
  2. Expanding globs to find all matching directories
  3. Reading each package.json to extract the name
Mitigation:
  • Use Homebrew installation (native binary is faster)
  • Cache isn’t implemented yet, so each command re-scans
  • Consider organizing workspace into fewer, larger packages
Note: This is a known limitation for very large monorepos.

Error Messages

Common Error Reference

Source reference: Error classes are defined in src/lib/errors.ts.

Getting Help

If you encounter an issue not covered here:
1

Check source code

Better PM is open source. You can inspect the implementation:
  • Package manager detection: src/pm/detect.ts
  • Install logic: src/commands/install.ts
  • Workspace parsing: src/pm/{pnpm,bun,npm}.ts
  • Shell integration: src/commands/activate.ts
2

Enable debug output

Run with verbose logging (if supported by Effect framework):
3

Report an issue

Open an issue on the GitHub repository with:
  • Your package manager and version
  • Better PM version (pm --version)
  • Full command and error output
  • Relevant workspace configuration (pnpm-workspace.yaml or package.json)

Prevention Tips

Use Homebrew

Install via Homebrew for best performance and fewer issues:

Activate Shell Integration

Add to your shell config for full functionality:

Keep Workspace Config Valid

Ensure your workspace configuration is correct:
  • pnpm: Valid pnpm-workspace.yaml
  • bun/npm: Valid workspaces in package.json

Use pm pls to Verify

Regularly check that Better PM detects your packages: