{"record":{"id":"b7fb2f1c3182ac09","repo":"nocobase/nocobase","slug":"plugin-name-plugin-need-requiredpluginname-p","errorCode":null,"errorMessage":"${plugin.name} plugin need ${requiredPluginName} plugin enabled","messagePattern":"(.+?) plugin need (.+?) plugin enabled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/server/src/plugin-manager/plugin-manager-repository.ts","lineNumber":63,"sourceCode":"      filter: {\n        name,\n      },\n    });\n  }\n\n  /**\n   * @deprecated\n   */\n  async enable(name: string | string[]) {\n    const pluginNames = lodash.castArray(name);\n    const plugins = pluginNames.map((name) => this.pm.get(name));\n\n    for (const plugin of plugins) {\n      const requiredPlugins = plugin.requiredPlugins();\n      for (const requiredPluginName of requiredPlugins) {\n        const requiredPlugin = this.pm.get(requiredPluginName);\n        if (!requiredPlugin.enabled) {\n          throw new Error(`${plugin.name} plugin need ${requiredPluginName} plugin enabled`);\n        }\n      }\n    }\n\n    for (const plugin of plugins) {\n      await plugin.beforeEnable();\n    }\n\n    await this.update({\n      filter: {\n        name,\n      },\n      values: {\n        enabled: true,\n        installed: true,\n      },\n    });\n    return pluginNames;","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/nocobase/nocobase/blob/fa42722fefe44265490dff2c27d79e2882bce4fa/packages/core/server/src/plugin-manager/plugin-manager-repository.ts#L45-L81","documentation":"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.","triggerScenarios":"`pm enable <plugin>` (or enable-all) where plugin A declares requiredPlugins() containing plugin B and B.enabled is false at enable time.","commonSituations":"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.","solutions":["Read the message: enable the named required plugin first, then retry","Use `yarn nocobase pm list` to see enabled/disabled state of dependencies","Chain enables in dependency order, or use pm enable-all after all packages are installed so dependencies resolve together","If the dependency is not installed at all, install its package before enabling"],"exampleFix":"// before\nyarn nocobase pm enable workflow-approval\n// Error: workflow-approval plugin need workflow plugin enabled\n// after\nyarn nocobase pm enable workflow\nyarn nocobase pm enable workflow-approval","handlingStrategy":"validation","validationCode":"const deps = plugin.requiredPlugins();\nconst disabled = deps.filter(name => { const d = app.pm.get(name); return !d || !d.enabled; });\nif (disabled.length) {\n  await app.pm.enable(disabled); // enable dependencies first\n}","typeGuard":null,"tryCatchPattern":"try {\n  await app.pm.enable([pluginName]);\n} catch (error) {\n  if (String(error).includes('plugin enabled')) {\n    // parse required plugin name from message, enable it, then retry\n  } else throw error;\n}","preventionTips":["Declare requiredPlugins() accurately in every plugin","Document enable order for dependent plugins","Use enable-all so the manager resolves dependencies in one pass"],"tags":["plugin-manager","dependency","enable"],"backgroundTag":"missing-plugin-dependency","analyzedSha":"fa42722fefe44265490dff2c27d79e2882bce4fa","analyzedAt":"2026-09-01T00:54:31.202Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}