【发布时间】:2021-02-26 10:21:48
【问题描述】:
Git hub 提供了有关如何安装各种软件包的说明。
但是当我在 PowerShell 中输入这些时,例如
go get -u github.com/disintegration/gift
我收到一条消息
package github.com/disintegration/gift: exec: "git": executable file not found in %PATH%
如何将包添加到路径?
【问题讨论】:
-
如果您使用 go 模块,那么系统会为您执行此操作...在您的源目录问题
go mod init中,它将合成一个文件go.mod然后您在源代码中添加到导入的任何内容都会每当您发出go build时,都会在本地自动安装...请参阅github.com/golang/go/wiki/Modules 的文档 -
我的默认源目录是什么?
-
同一主题 ;) : stackoverflow.com/questions/36044275/…
-
谢谢。我看到 PATHEXT,但没有看到 PATH,而且我不确定编辑是什么意思。另外,我给系统变量取什么名字重要吗?
-
我添加了一个变量路径,设置为 /gin/bin/bash.exe,现在它说 go is not Recognized go : The term 'go' is not Recognized as the name of a cmdlet、函数、脚本文件或可运行的程序。检查名称的拼写,或者如果包含路径,请验证路径是否正确并重试。在 line:1 char:1 + go run main.go + ~~ + CategoryInfo : ObjectNotFound: (go:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
标签: windows powershell shell go path