Vagrant up 命令给出在 %PATH% 错误中找不到的可执行文件

Vagrant up command gives executable not found in %PATH% error

我已经安装了vagrant并且成功添加了vagrant ubuntu box。但是在项目目录中的 运行 "vagrant up" 命令上,我得到了这个错误:

The executable "powershell" vagrant is trying to run was not found in the %Path% variable.This is an error.Please verify this software is installed and on path.

我也安装了Putty客户端并进行了配置

注意:"vagrant init" 命令工作正常,它在目录中创建了一个 vagrant 文件。 流浪者版本:1.9.7

VagrantFile 包含

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/xenial32"
end

添加到环境变量的路径:C:\HashiCorp\Vagrant\bin

在您的计算机中找不到 powershell 命令。

运行 在你的机器上运行 powershell 命令并检查它是否正常工作。

预期结果应该是:

*

C:\Users\navkuma>powershell
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
PS C:\Users\navkuma>

*

您应该将此行添加到您的 Path 变量中,然后 vagrant 开始工作。

%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\