{"record":{"id":"9152e9f81f73a260","repo":"vuejs/vue-cli","slug":"cannot-resolve-plugin-pluginname-from-package-j","errorCode":null,"errorMessage":"Cannot resolve plugin ${pluginName} from package.json. Did you forget to install it?","messagePattern":"Cannot resolve plugin (.+?) from package\\.json\\. Did you forget to install it\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@vue/cli/lib/invoke.js","lineNumber":47,"sourceCode":"  const pkg = getPkg(context)\n\n  // attempt to locate the plugin in package.json\n  const findPlugin = deps => {\n    if (!deps) return\n    let name\n    // official\n    if (deps[(name = `@vue/cli-plugin-${pluginName}`)]) {\n      return name\n    }\n    // full id, scoped short, or default short\n    if (deps[(name = resolvePluginId(pluginName))]) {\n      return name\n    }\n  }\n\n  const id = findPlugin(pkg.devDependencies) || findPlugin(pkg.dependencies)\n  if (!id) {\n    throw new Error(\n      `Cannot resolve plugin ${chalk.yellow(pluginName)} from package.json. ` +\n        `Did you forget to install it?`\n    )\n  }\n\n  const pluginGenerator = loadModule(`${id}/generator`, context)\n  if (!pluginGenerator) {\n    throw new Error(`Plugin ${id} does not have a generator.`)\n  }\n\n  // resolve options if no command line options (other than --registry) are passed,\n  // and the plugin contains a prompt module.\n  // eslint-disable-next-line prefer-const\n  let { registry, $inlineOptions, ...pluginOptions } = options\n  if ($inlineOptions) {\n    try {\n      pluginOptions = JSON.parse($inlineOptions)\n    } catch (e) {","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/vuejs/vue-cli/blob/7eb93c169c7520935252e2473387f923ef80d856/packages/@vue/cli/lib/invoke.js#L29-L65","documentation":"Thrown during `vue invoke <plugin>` when the named plugin cannot be resolved from the project's package.json dependencies or devDependencies. The invoke command searches for the plugin under @vue/cli-plugin-, vue-cli-plugin-, scoped variants, and the full resolved ID; if none appears in the dependency lists, it assumes the plugin was never installed.","triggerScenarios":"Running `vue invoke router` when @vue/cli-plugin-router is not in package.json. Or `vue invoke my-plugin` when vue-cli-plugin-my-plugin is not installed.","commonSituations":"User hasn't installed the plugin yet, typos the plugin name, or the plugin was scaffolded but not saved as a dependency. Also when invoking a plugin that was uninstalled.","solutions":["Install the plugin first: npm install -D @vue/cli-plugin-<name> (or vue-cli-plugin-<name> for community plugins).","Double-check the plugin name spelling and prefix conventions.","Run `npm list | grep cli-plugin` to see what's actually installed."],"exampleFix":"# before\n$ vue invoke router  # not installed\nError: Cannot resolve plugin router\n# after\n$ npm install -D @vue/cli-plugin-router\n$ vue invoke router","handlingStrategy":"validation","validationCode":"const pkg = require('./package.json');\nconst deps = { ...pkg.dependencies, ...pkg.devDependencies };\nconst candidates = [\n  `@vue/cli-plugin-${name}`,\n  `vue-cli-plugin-${name}`,\n  `${name}`,\n  `@vue/${name}`,\n];\nconst found = candidates.find(c => deps[c]);\nif (!found) console.error(`Plugin ${name} not found in package.json. Install it first.`);","typeGuard":null,"tryCatchPattern":"try {\n  await invoke(pluginName, options);\n} catch (e) {\n  if (e.message.includes('Cannot resolve plugin')) {\n    console.error(`Install the plugin first: npm install -D @vue/cli-plugin-${pluginName}`);\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Install plugins before invoking: npm install -D <plugin>.","Double-check plugin name spelling and prefix conventions.","Use `npm list | grep cli-plugin` to confirm installed plugins."],"tags":["invoke","dependency","package-json","plugin","command-line"],"backgroundTag":null,"analyzedSha":"7eb93c169c7520935252e2473387f923ef80d856","analyzedAt":"2026-08-13T10:13:37.803Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}