claude-code - 💡(How to fix) Fix [BUG] /plugin update never detects new versions for npm-sourced plugins — lockfile not refreshed [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54132Fetched 2026-04-28 06:38:22
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Error Message

Error Messages/Logs

No specific error message, just the feature not working properly due to code being bugged.

Code Example

No specific error message, just the feature not working properly due to code being bugged.

---

{
  "name": "test-marketplace",
  "plugins": [
    {
      "name": "test-plugin",
      "source": {
        "source": "npm",
        "package": "@org/test-plugin",
        "registry": "https://registry.example.com/"
      }
    }
  ]
}

---

/plugin marketplace add https://registry.example.com/marketplace.json
/plugin install test-plugin@test-marketplace
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

/plugin update does not detect latest version (pinned or not) for npn sourced plugins.

Claude Code maintains its own npm workspace at ~/.claude/plugins/npm-cache/. When an npm-sourced plugin is installed, it writes a package.json with the installed version pinned (e.g. "@yourOrg/plugin-name": "^1.6.3") and a package-lock.json locking to that exact version.

When /plugin checks for updates, it reads the lockfile rather than querying the live registry. Since the lockfile is never refreshed unless npm install is explicitly run, it always reports the installed version as "latest."

npm install run only when there is no install folder for the version seen as the latest one - in this case the latest version installed, not the latest version published on the registry. (Google Artifact Registry in my case, but would be the same with any registry, public or private i believe)

What Should Happen?

/plugin update detects and installs the latest version.

When no specific version is mentioned in the marketplace for npm sourced plugin, it should default to the latest. In such case, npm install should be run first to update the lock file, then the update to whatever latest version is found should be done without any issue.

Error Messages/Logs

No specific error message, just the feature not working properly due to code being bugged.

Steps to Reproduce

  1. Set up a private npm registry (e.g., Nexus, Verdaccio, Artifactory)
  2. Create a marketplace.json with an npm-sourced plugin (no need to specify version):
{
  "name": "test-marketplace",
  "plugins": [
    {
      "name": "test-plugin",
      "source": {
        "source": "npm",
        "package": "@org/test-plugin",
        "registry": "https://registry.example.com/"
      }
    }
  ]
}
  1. Add the marketplace and install the plugin:
/plugin marketplace add https://registry.example.com/marketplace.json
/plugin install test-plugin@test-marketplace
  1. Publish a new version (e.g., 1.1.0) of the plugin to your npm registry
  2. Try to update the plugin: claude plugin update test-plugin@test-marketplace
  3. Do the same with updating your marketplace before (should not change anything)

Claude Model

Opus

Is this a regression?

No, this never worked. Has also been reported here and closed due to innactivity. But the bug is there and should be fixed, or remote entirely the support for npm sourced plugins as it just does not work.

Last Working Version

No response

Claude Code Version

2.1.121 (originally found on stable channel with 2.1.112)

Platform

Google Vertex AI

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

Found from a leaked version of claude code, somewhere in your code, you are running npm install only when there is no local folder matching the plugin version considered as the one to install or update. This is a chicken-egg issue since the version check is done against the local lock file, not the remote registry, and the remote registry would be checked only when the npm install actually run..

Options to fix it (if the real code is still doing this)

  1. Either refactor the entire logic to properly handle version discovery (pinned or latest use cases) for npm sourced plugins
  2. Or introduce a force option in the /plugin skill to force the npm install to run to properly update the local npm cache and lock files.

extent analysis

TL;DR

The issue can be fixed by refactoring the version discovery logic for npm-sourced plugins to query the live registry instead of relying on the local lockfile.

Guidance

  • The current implementation only runs npm install when there is no local folder matching the plugin version, causing the version check to be done against the local lockfile instead of the remote registry.
  • To fix this, the logic should be refactored to properly handle version discovery for npm-sourced plugins, considering both pinned and latest use cases.
  • Introducing a force option in the /plugin skill to force npm install to run could be a temporary workaround to update the local npm cache and lock files.
  • Verifying the fix involves checking that the /plugin update command correctly detects and installs the latest version of an npm-sourced plugin.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The provided information suggests that the issue is due to the current implementation's reliance on the local lockfile for version checks. Refactoring the logic to query the live registry would likely resolve the issue.

Recommendation

Apply a workaround by introducing a force option in the /plugin skill to force npm install to run, as this would allow for proper updating of the local npm cache and lock files. This is a temporary solution until the version discovery logic can be refactored.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] /plugin update never detects new versions for npm-sourced plugins — lockfile not refreshed [1 participants]