【问题标题】:Boo to the Chocolatey Gods嘘巧克力之神
【发布时间】:2014-05-02 18:07:13
【问题描述】:

更新:

此实用程序旨在通过我正在观看的经过认证的 Microsoft Visual Academy (MVA) 视频帮助配置 Git

当我通过 Chocolatey 安装软件包时收到一个特殊错误。

  • 我已上传命令提示符
  • 指向 Chocolatey Bin 目录的目录
  • 尝试通过cinst poshgit安装

它会下载并显示它正在运行,它甚至会在C:\Tools\Poshgit 下创建目录。然后它给了我以下信息:

[错误] 无法将参数绑定到参数“路径”,因为它是 空字符串。在 C:\Chocolatey\ChocolateyInstall\Helpers\functions\Writer-ChocolateyFailure.ps1:30 字符 2

这导致了失败,我也不完全确定为什么。它是 Chocolatey 的全新安装。我做错了吗?

【问题讨论】:

  • @MichaelDautermann 这个错误实际上包括“向巧克力之神嘘!”
  • +1 仅用于标题。
  • 虽然“关于通用计算硬件和软件的问题”是题外话,但“程序员常用的软件工具”绝对是题外话。 git(和 posh-git)绝对是常用的软件工具。

标签: c# git powershell command-line chocolatey


【解决方案1】:

所以安装 GitPosh-Git 并不太愉快,我修复错误的方法是重新安装 Chocolatey,然后执行以下:

@Powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

我知道这是一个乏味的命令,但我重新安装了上述命令,然后通过 Power Shell 执行了以下操作(以管理员身份运行)。

Set-ExecutionPolicy RemoteSigned
cinst poshgit 

这并没有完全解决,因为有前一次失败的回忆,所以我做了:

cinst poshgit -force
cinst git.install -force
git

一旦我输入了git,我就可以访问git 命令并且能够:

git config --global user.name "Your Name"
git config --global user.email "Your Email"
cinst git-credential-winstore

如果没有任何其他问题,来自命令行安装的问题应该从Power Shell开始。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-07-16
    • 2022-10-25
    • 2020-12-22
    • 2014-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多