vuejs/vue-cli · error · Error

At least one dependency can't be found. Please install the…

Error message

At least one dependency can't be found. Please install the dependencies before trying to upgrade

What it means

Thrown during a full upgrade (`vue upgrade` without a specific plugin) when at least one @vue/cli-service or cli-plugin dependency listed in package.json is not installed in node_modules. The upgrader iterates all Vue CLI-related dependencies and checks each one's installed version; finding any uninstalled dependency aborts the entire upgrade.

Solutions

  1. Run npm install (or yarn/pnpm install) to install all dependencies before upgrading.
  2. Run `npm list --depth=0` to verify all @vue/cli-plugin-* packages are installed.
  3. If a specific plugin can't be installed, remove it from package.json before upgrading, or fix the install error first.

Example fix

# before
$ vue upgrade  # some plugins not in node_modules
# after
$ npm install
$ npm list --depth=0 | grep cli-plugin
$ vue upgrade
Defensive patterns

Strategy: validation

Validate before calling

const pkg = require('./package.json');
const { existsSync } = require('fs');
const depTypes = ['dependencies', 'devDependencies', 'optionalDependencies'];
const missing = [];
for (const dt of depTypes) {
  for (const name of Object.keys(pkg[dt] || {})) {
    if (name === '@vue/cli-service' || name.startsWith('vue-cli-plugin-') || name.startsWith('@vue/cli-plugin-')) {
      if (!existsSync(`node_modules/${name}/package.json`)) missing.push(name);
    }
  }
}
if (missing.length) console.error('Missing from node_modules:', missing.join(', '));

Try / catch

try {
  await upgrader.upgradeAll();
} catch (e) {
  if (e.message.includes("At least one dependency can't be found")) {
    console.error('Run npm install before upgrading.');
    process.exit(1);
  }
  throw e;
}

Prevention

When it happens

Trigger: Running `vue upgrade` (upgrade all) when one or more Vue CLI plugins listed in package.json are missing from node_modules. getInstalledVersion returns falsy for at least one dependency.

Common situations: After a partial npm install failure, after deleting node_modules but not reinstalling, or when a plugin was added to package.json manually without running install. CI pipelines that skip install steps.

Related errors


AI-assisted analysis of vuejs/vue-cli@7eb93c169c (2026-08-13). Data as JSON: /api/errors/c9f740f8fe218f55. Report an issue: GitHub.

Appendix: source

Thrown at packages/@vue/cli/lib/Upgrader.js:160

    }
  }

  async getUpgradable (includeNext) {
    const upgradable = []

    // get current deps
    // filter @vue/cli-service, @vue/cli-plugin-* & vue-cli-plugin-*
    for (const depType of ['dependencies', 'devDependencies', 'optionalDependencies']) {
      for (const [name, range] of Object.entries(this.pkg[depType] || {})) {
        if (name !== '@vue/cli-service' && !isPlugin(name)) {
          continue
        }

        const installed = await this.pm.getInstalledVersion(name)
        const wanted = await this.pm.getRemoteVersion(name, range)

        if (!installed) {
          throw new Error(`At least one dependency can't be found. Please install the dependencies before trying to upgrade`)
        }

        let latest = await this.pm.getRemoteVersion(name)
        if (includeNext) {
          const next = await this.pm.getRemoteVersion(name, 'next')
          if (next) {
            latest = semver.gte(latest, next) ? latest : next
          }
        }

        if (semver.lt(installed, latest)) {
          // always list @vue/cli-service as the first one
          // as it's depended by all other plugins
          if (name === '@vue/cli-service') {
            upgradable.unshift({ name, installed, wanted, latest })
          } else {
            upgradable.push({ name, installed, wanted, latest })
          }

View on GitHub (pinned to 7eb93c169c)