Skip to main content

Overview

The pm unlink command removes symbolic links created by pm link, restoring packages to their published versions from the registry.

Syntax

Arguments

string[]
Package names or arguments passed to your package manager’s unlink command

Examples

Output
This removes the symbolic link and restores the package from the registry. In the project with linked packages:
Output
In the package that was globally linked:
Output

Use Cases

After Local Development

When you’re done developing locally:
1

Unlink Package

Remove the symbolic link:
2

Reinstall from Registry

Install the published version:
3

Verify

Check the package is from registry:

Before Deployment

Ensure no development links exist:
Always unlink packages before deploying to production to avoid missing dependencies.

Switching Development Setup

Switch from linked to published version:

How It Works

From src/commands/unlink.ts:10-17:
The command:
  1. Detects your package manager
  2. Passes all arguments to the native unlink command
  3. Removes symbolic links from node_modules

Package Manager Behavior

Verification

Check if package is still linked:
Output (linked)
Output (unlinked)
No -> arrow means it’s installed normally.

Restore Published Version

After unlinking, reinstall from registry:
Or reinstall specific package:

Common Workflows

Complete Cleanup

Remove all development links:

Switch Between Linked and Published

Troubleshooting

Package Still Linked

If unlink doesn’t work:
  1. Manual removal:
  2. Clean reinstall:

Module Resolution Issues

After unlinking, you may need to:

Best Practices

  • Unlink before commits - Don’t commit with linked packages
  • Document linked packages - Keep track of what’s linked
  • Verify after unlink - Check with pm ls that links are removed
  • Clean install after - Run pm install to restore published versions
If you’re working in a monorepo, workspace features handle linking automatically - you don’t need manual link/unlink.
  • pm link - Create symbolic links
  • pm ls - List dependencies and check for links
  • pm install - Reinstall packages from registry