Molunerfinn/PicGo · error

Update plugin failed

Error message

Update plugin failed

What it means

updatePlugin throws when the UPDATE_PLUGIN RPC via pluginsAdapter.updatePlugin(fullName) returns success:false, with result.error or fallback 'Update plugin failed'. After a successful update the action rehydrates app state and flags a needReload so the plugin's new code takes effect.

Source

Thrown at src/renderer/store/plugins/actions.ts:221

      if (!result.success) {
        throw new Error(result.error || 'Toggle plugin failed')
      }

      await appActions.hydrateAppState()
      const installedPlugins = await pluginsAdapter.getInstalledPlugins()
      pluginStoreActions.setInstalledPlugins(installedPlugins.map(mapInstalledPluginItem))
      toast.success(i18n.t(enabled ? 'ENABLE_PLUGIN' : 'DISABLE_PLUGIN'))
    } finally {
      pluginStoreActions.setMutating(fullName, false)
    }
  },
  async updatePlugin (fullName: string) {
    pluginStoreActions.setMutating(fullName, true)

    try {
      const result = await pluginsAdapter.updatePlugin(fullName)
      if (!result.success) {
        throw new Error(result.error || 'Update plugin failed')
      }
      await appActions.hydrateAppState()
      const installedPlugins = await pluginsAdapter.getInstalledPlugins()
      pluginStoreActions.setInstalledPlugins(installedPlugins.map(mapInstalledPluginItem))
      await pluginsAdapter.setNeedReload(true)

      useAppStore.setState((state) => {
        if (state.appConfig) {
          state.appConfig.needReload = true
        }
      })
      toast.success(i18n.t('PLUGIN_UPDATE_SUCCEED'))
    } finally {
      pluginStoreActions.setMutating(fullName, false)
    }
  },
  async uninstallPlugin (fullName: string) {
    pluginStoreActions.setMutating(fullName, true)

View on GitHub (pinned to 07ec7068a5)

Solutions

  1. Read result.error for npm's failure detail; confirm network/registry access and retry.
  2. Check whether the plugin actually needs updating — no newer version can surface as failure.
  3. If the newest version is incompatible, pin/avoid it or upgrade PicGo core first.
  4. Remove and reinstall the plugin if node_modules is corrupted, then retry update.
  5. After a successful update, restart/reload the app so setNeedReload takes effect.

Example fix

null
Defensive patterns

Strategy: retry

Validate before calling

const installed = useAppStore.getState().pluginsInstalled
const plugin = installed.find(p => p.fullName === fullName)
if (!plugin) { toast.error(i18n.t('PLUGIN_NOT_FOUND')); return }
// skip if already latest
if (plugin.version && plugin.latestVersion && plugin.version === plugin.latestVersion) {
  toast.info(i18n.t('PLUGIN_ALREADY_LATEST'))
  return
}

Type guard

function isUpdateSuccess(r: { success: boolean, error?: string }): r is { success: true } {
  return r.success === true
}

Try / catch

try {
  await pluginStoreActions.updatePlugin(fullName)
  // app reloads / needReload flag set on success
} catch (e) {
  toast.error(e instanceof Error ? e.message : i18n.t('PLUGIN_UPDATE_FAILED'))
  pluginStoreActions.setMutating(fullName, false)
}

Prevention

When it happens

Trigger: npm update in the main process fails: no newer version or registry unreachable, peer/version conflict with picgo core, network/proxy failure, or the plugin's latest version breaks (incompatible API), causing the update step to report failure.

Common situations: Updating while offline or behind a proxy; plugin latest release requires a newer PicGo core; registry mirror lagging; lockfile/node_modules corruption in the plugin dir.

Related errors


AI-assisted analysis of Molunerfinn/PicGo@07ec7068a5 (2026-08-30). Data as JSON: /api/errors/ed51a1f54c178f4d. Report an issue: GitHub.