hashicorp/vagrant · error · Vagrant::Errors::PluginNotInstalled

The plugin '%{name}' is not currently installed.

Error message

The plugin '%{name}' is not currently installed.

What it means

The PluginExistsCheck middleware runs before uninstall/update/license plugin actions. It looks up env[:plugin_name] in Vagrant::Plugin::Manager.instance.installed_plugins (backed by ~/.vagrant.d/plugins.json, or the project-local .vagrant/plugins.json for --local) and raises Vagrant::Errors::PluginNotInstalled when the name is not a key. The name must match the installed gem name exactly.

Source

Thrown at plugins/commands/plugin/action/plugin_exists_check.rb:19

# Copyright IBM Corp. 2010, 2025
# SPDX-License-Identifier: BUSL-1.1

require "vagrant/plugin/manager"

module VagrantPlugins
  module CommandPlugin
    module Action
      # This class checks to see if the plugin is installed already, and
      # if so, raises an exception/error to output to the user.
      class PluginExistsCheck
        def initialize(app, env)
          @app    = app
        end

        def call(env)
          installed = Vagrant::Plugin::Manager.instance.installed_plugins
          if !installed.key?(env[:plugin_name])
            raise Vagrant::Errors::PluginNotInstalled,
              name: env[:plugin_name]
          end

          @app.call(env)
        end
      end
    end
  end
end

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. List exact installed names: `vagrant plugin list`.
  2. Re-run the command with the exact name shown in that list.
  3. If the plugin lives in the project scope, add --local (and drop it for global scope).
  4. If plugins.json was wiped, reinstall first: `vagrant plugin install <name>`.

Example fix

# before
vagrant plugin uninstall aws            # wrong: installed name is vagrant-aws
# after
vagrant plugin list                      # confirm exact name
vagrant plugin uninstall vagrant-aws
Defensive patterns

Strategy: validation

Validate before calling

installed = `vagrant plugin list`.lines.map { |l| l.split.first }
abort "#{ARGV[0]} is not installed; installed: #{installed.join(', ')}" unless installed.include?(ARGV[0])
system('vagrant', 'plugin', 'uninstall', ARGV[0])

Try / catch

begin
  Vagrant::Environment.new.cli(['plugin', 'uninstall', name])
rescue Vagrant::Errors::PluginNotInstalled => e
  warn e.extra_data[:name]
  # recover: refresh the list, or fall through to a no-op
  exit 0
end

Prevention

When it happens

Trigger: `vagrant plugin uninstall aws` when the gem is actually installed as vagrant-aws; the plugin was already removed; VAGRANT_HOME changed so the manager reads a different plugins.json; using --local when the plugin is installed globally (or vice versa).

Common situations: Gem name vs human name mismatch; a failed `vagrant plugin expunge` leaving plugins.json empty; new machines or CI runners that never had the plugin installed.

Related errors


AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21). Data as JSON: /api/errors/e64bf88ad92c2111. Report an issue: GitHub.