unity_repair_package_cache
Repair a stale Unity Package Manager cache for a git-dependency package. Resolves 'Failed to rename' errors or hash mismatches by deleting corrupted cache folders and lock entry, then re-resolves on next editor launch.
Instructions
Force a clean re-resolve of a stale UPM git-dependency package. Use on a packages-lock.json hash mismatch against Library/PackageCache, or a 'Failed to rename ... EPERM' error during resolve. Deletes the stale Library/PackageCache/@* folder(s) and removes the package's packages-lock.json entry so Package Manager re-resolves it fresh on next editor launch. Refuses to run while a Unity editor process is open unless force=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Repair even if a Unity editor process is currently running. Leave false unless you've independently confirmed it's safe. | |
| packageName | Yes | UPM package name to repair, e.g. 'com.accelbyte.ui-tools'. | |
| projectPath | Yes | Unity project root. |