nocobase/nocobase · error

${plugin.name} plugin need ${requiredPluginName} plugin enab

Error message

${plugin.name} plugin need ${requiredPluginName} plugin enabled

What it means

During plugin enable, PluginManagerRepository iterates each plugin's requiredPlugins() and verifies each required plugin is currently enabled. If a dependency is installed but disabled (or missing), enabling is aborted with this message so dependent plugins never run without their prerequisites.

Source

Thrown at packages/core/server/src/plugin-manager/plugin-manager-repository.ts:63

      filter: {
        name,
      },
    });
  }

  /**
   * @deprecated
   */
  async enable(name: string | string[]) {
    const pluginNames = lodash.castArray(name);
    const plugins = pluginNames.map((name) => this.pm.get(name));

    for (const plugin of plugins) {
      const requiredPlugins = plugin.requiredPlugins();
      for (const requiredPluginName of requiredPlugins) {
        const requiredPlugin = this.pm.get(requiredPluginName);
        if (!requiredPlugin.enabled) {
          throw new Error(`${plugin.name} plugin need ${requiredPluginName} plugin enabled`);
        }
      }
    }

    for (const plugin of plugins) {
      await plugin.beforeEnable();
    }

    await this.update({
      filter: {
        name,
      },
      values: {
        enabled: true,
        installed: true,
      },
    });
    return pluginNames;

View on GitHub (pinned to fa42722fef)

Solutions

  1. Read the message: enable the named required plugin first, then retry
  2. Use `yarn nocobase pm list` to see enabled/disabled state of dependencies
  3. Chain enables in dependency order, or use pm enable-all after all packages are installed so dependencies resolve together
  4. If the dependency is not installed at all, install its package before enabling

Example fix

// before
yarn nocobase pm enable workflow-approval
// Error: workflow-approval plugin need workflow plugin enabled
// after
yarn nocobase pm enable workflow
yarn nocobase pm enable workflow-approval
Defensive patterns

Strategy: validation

Validate before calling

const deps = plugin.requiredPlugins();
const disabled = deps.filter(name => { const d = app.pm.get(name); return !d || !d.enabled; });
if (disabled.length) {
  await app.pm.enable(disabled); // enable dependencies first
}

Try / catch

try {
  await app.pm.enable([pluginName]);
} catch (error) {
  if (String(error).includes('plugin enabled')) {
    // parse required plugin name from message, enable it, then retry
  } else throw error;
}

Prevention

When it happens

Trigger: `pm enable <plugin>` (or enable-all) where plugin A declares requiredPlugins() containing plugin B and B.enabled is false at enable time.

Common situations: Enabling an add-on like workflow-approval without first enabling workflow; a plugin upgrade that added a new requiredPlugins entry the user doesn't have enabled; enable-all processing order hitting a broken dependency chain.

Related errors


AI-assisted analysis of nocobase/nocobase@fa42722fef (2026-09-01). Data as JSON: /api/errors/b7fb2f1c3182ac09. Report an issue: GitHub.