Installation Issues
Command not found: pm
Command not found: pm
Package Manager Detection
No lock file found. Could not detect package manager
No lock file found. Could not detect package manager
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:
- No lockfile exists
- Wrong directory
- Lockfile above home directory
Generate one by running your package manager’s install command:This creates the lockfile, after which Better PM will work.
Wrong package manager detected
Wrong package manager detected
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):pnpm-lock.yaml→ pnpmbun.lock→ bunbun.lockb→ bunpackage-lock.json→ npm
Workspace Detection
Workspace packages not detected
Workspace packages not detected
Symptoms:Cause: Workspace configuration is missing or malformed.Diagnosis:Solution:Add or fix workspace configuration, then test:
- pnpm
- bun
- npm
Check for Should contain:Common issues:
pnpm-workspace.yaml:- File doesn’t exist: Create it with your package globs
- Incorrect indentation: YAML is whitespace-sensitive
- Missing quotes: Use quotes for globs with wildcards
Some packages missing from pm pls
Some packages missing from pm pls
Symptoms:Cause: Package doesn’t match workspace glob patterns, or lacks a
package.json.Diagnosis:Shell Integration
pm cd doesn't change directory
pm cd doesn't change directory
Tab completion doesn't show packages
Tab completion doesn't show packages
Slow tab completions
Slow tab completions
Symptoms: Typing Then reload shell and test:
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:
Command Execution
pm i installs all packages at root
pm i installs all packages at root
Symptoms:Expected behavior: Should show a warning and prompt for confirmation.Cause: Using Check environment:Solution:
-y / --sure flag, or running in non-interactive environment.Diagnosis:Check your command:- To install specific packages:
pm i -F @myapp/web - To install everything intentionally:
pm i -y - For safety, always
cdinto a package before runningpm i
pm add with pasted command fails
pm add with pasted command fails
Symptoms:Common issues:Cause: Pasted command has no package names.Solution: Include the package name:
- No packages extracted
- Unsupported package manager
- Version specifiers
Performance Issues
Slow command execution
Slow command execution
Large monorepo operations are slow
Large monorepo operations are slow
Symptoms:
pm pls or pm cd takes several seconds in a monorepo with 100+ packages.Cause: Better PM enumerates all workspace packages by:- Reading workspace globs from config
- Expanding globs to find all matching directories
- Reading each package.json to extract the name
- Use Homebrew installation (native binary is faster)
- Cache isn’t implemented yet, so each command re-scans
- Consider organizing workspace into fewer, larger packages
Error Messages
Common Error Reference
src/lib/errors.ts.
Getting Help
If you encounter an issue not covered here: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
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
workspacesinpackage.json
Use pm pls to Verify
Regularly check that Better PM detects your packages: