安装依赖项导致 VS Code 安装失败
来源:stackoverflow
时间:2024-03-08 08:00:25 267浏览 收藏
一分耕耘,一分收获!既然都打开这篇《安装依赖项导致 VS Code 安装失败》,就坚持看下去,学下去吧!本文主要会给大家讲到等等知识点,如果大家对本文有好的建议或者看到有不足之处,非常欢迎大家积极提出!在后续文章我会继续更新Golang相关的内容,希望对大家都有所帮助!
问题内容
我尝试使用这里的示例https://github.com/dejavuzhou/felix
我已经从那里成功创建了我的项目。我的项目运行良好。只是当我用vscode打开项目时,总是发现下载依赖项的通知
但是当我按 install all
下载所有依赖项时总是失败。
vscode 的错误报告
Installing 8 tools at C:\Users\berth\go\bin gocode go-outline go-symbols guru gorename gocode-gomod goreturns golint C:\Users\berth\go\src\github.com\berthojoris\ginbro\handlers>Finished running tool: C:\Go\bin\go.exe build -i -o C:\Users\berth\AppData\Local\Temp\vscode-go8ZWFLb\go-code-check github.com\berthojoris\ginbro\handlers C:\Users\berth\go\src\github.com\berthojoris\ginbro\handlers>Finished running tool: C:\Go\bin\go.exe vet ./... Installing github.com/mdempsky/gocode FAILED Installing github.com/ramya-rao-a/go-outline FAILED Installing github.com/acroca/go-symbols FAILED Installing golang.org/x/tools/cmd/guru FAILED Installing golang.org/x/tools/cmd/gorename FAILED Installing github.com/stamblerre/gocode FAILED Installing github.com/sqs/goreturns FAILED Installing golang.org/x/lint/golint FAILED 8 tools failed to install. gocode: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/mdempsky/gocode github.com/mdempsky/gocode (download) # cd C:\Users\berth\go\src\github.com\mdempsky\gocode; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pullIf you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package github.com/mdempsky/gocode: exit status 1 github.com/mdempsky/gocode (download) # cd C:\Users\berth\go\src\github.com\mdempsky\gocode; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package github.com/mdempsky/gocode: exit status 1 go-outline: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/ramya-rao-a/go-outline github.com/ramya-rao-a/go-outline (download) Fetching https://golang.org/x/tools/go/buildutil?go-get=1 Parsing meta tags from https://golang.org/x/tools/go/buildutil?go-get=1 (status code 200) get "golang.org/x/tools/go/buildutil": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/buildutil?go-get=1 get "golang.org/x/tools/go/buildutil": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/go/buildutil: exit status 1 github.com/ramya-rao-a/go-outline (download) Fetching https://golang.org/x/tools/go/buildutil?go-get=1 Parsing meta tags from https://golang.org/x/tools/go/buildutil?go-get=1 (status code 200) get "golang.org/x/tools/go/buildutil": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/buildutil?go-get=1 get "golang.org/x/tools/go/buildutil": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/go/buildutil: exit status 1 go-symbols: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/acroca/go-symbols github.com/acroca/go-symbols (download) Fetching https://golang.org/x/tools/go/buildutil?go-get=1 Parsing meta tags from https://golang.org/x/tools/go/buildutil?go-get=1 (status code 200) get "golang.org/x/tools/go/buildutil": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/buildutil?go-get=1 get "golang.org/x/tools/go/buildutil": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/go/buildutil: exit status 1 github.com/acroca/go-symbols (download) Fetching https://golang.org/x/tools/go/buildutil?go-get=1 Parsing meta tags from https://golang.org/x/tools/go/buildutil?go-get=1 (status code 200) get "golang.org/x/tools/go/buildutil": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/buildutil?go-get=1 get "golang.org/x/tools/go/buildutil": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/go/buildutil: exit status 1 guru: Error: Command failed: C:\Go\bin\go.exe get -u -v golang.org/x/tools/cmd/guru Fetching https://golang.org/x/tools/cmd/guru?go-get=1 Parsing meta tags from https://golang.org/x/tools/cmd/guru?go-get=1 (status code 200) get "golang.org/x/tools/cmd/guru": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/guru?go-get=1 get "golang.org/x/tools/cmd/guru": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/cmd/guru: exit status 1 Fetching https://golang.org/x/tools/cmd/guru?go-get=1 Parsing meta tags from https://golang.org/x/tools/cmd/guru?go-get=1 (status code 200) get "golang.org/x/tools/cmd/guru": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/guru?go-get=1 get "golang.org/x/tools/cmd/guru": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/cmd/guru: exit status 1 gorename: Error: Command failed: C:\Go\bin\go.exe get -u -v golang.org/x/tools/cmd/gorename Fetching https://golang.org/x/tools/cmd/gorename?go-get=1 Parsing meta tags from https://golang.org/x/tools/cmd/gorename?go-get=1 (status code 200) get "golang.org/x/tools/cmd/gorename": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/gorename?go-get=1 get "golang.org/x/tools/cmd/gorename": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/cmd/gorename: exit status 1 Fetching https://golang.org/x/tools/cmd/gorename?go-get=1 Parsing meta tags from https://golang.org/x/tools/cmd/gorename?go-get=1 (status code 200) get "golang.org/x/tools/cmd/gorename": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/gorename?go-get=1 get "golang.org/x/tools/cmd/gorename": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/cmd/gorename: exit status 1 gocode-gomod: Error: Command failed: C:\Go\bin\go.exe get -u -v -d github.com/stamblerre/gocode github.com/stamblerre/gocode (download) Fetching https://golang.org/x/tools/go/packages?go-get=1 Parsing meta tags from https://golang.org/x/tools/go/packages?go-get=1 (status code 200) get "golang.org/x/tools/go/packages": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/packages?go-get=1 get "golang.org/x/tools/go/packages": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/go/packages: exit status 1 github.com/stamblerre/gocode (download) Fetching https://golang.org/x/tools/go/packages?go-get=1 Parsing meta tags from https://golang.org/x/tools/go/packages?go-get=1 (status code 200) get "golang.org/x/tools/go/packages": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/packages?go-get=1 get "golang.org/x/tools/go/packages": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/go/packages: exit status 1 goreturns: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/sqs/goreturns github.com/sqs/goreturns (download) Fetching https://golang.org/x/tools/imports?go-get=1 Parsing meta tags from https://golang.org/x/tools/imports?go-get=1 (status code 200) get "golang.org/x/tools/imports": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/imports?go-get=1 get "golang.org/x/tools/imports": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/imports: exit status 1 github.com/sqs/goreturns (download) Fetching https://golang.org/x/tools/imports?go-get=1 Parsing meta tags from https://golang.org/x/tools/imports?go-get=1 (status code 200) get "golang.org/x/tools/imports": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/imports?go-get=1 get "golang.org/x/tools/imports": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/imports: exit status 1 golint: Error: Command failed: C:\Go\bin\go.exe get -u -v golang.org/x/lint/golint Fetching https://golang.org/x/lint/golint?go-get=1 Parsing meta tags from https://golang.org/x/lint/golint?go-get=1 (status code 200) get "golang.org/x/lint/golint": found meta tag get.metaImport{Prefix:"golang.org/x/lint", VCS:"git", RepoRoot:"https://go.googlesource.com/lint"} at https://golang.org/x/lint/golint?go-get=1 get "golang.org/x/lint/golint": verifying non-authoritative meta tag Fetching https://golang.org/x/lint?go-get=1 Parsing meta tags from https://golang.org/x/lint?go-get=1 (status code 200) golang.org/x/lint (download) Fetching https://golang.org/x/lint?go-get=1 Parsing meta tags from https://golang.org/x/lint?go-get=1 (status code 200) get "golang.org/x/lint": found meta tag get.metaImport{Prefix:"golang.org/x/lint", VCS:"git", RepoRoot:"https://go.googlesource.com/lint"} at https://golang.org/x/lint?go-get=1 Fetching https://golang.org/x/tools/go/ast/astutil?go-get=1 Parsing meta tags from https://golang.org/x/tools/go/ast/astutil?go-get=1 (status code 200) get "golang.org/x/tools/go/ast/astutil": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/ast/astutil?go-get=1 get "golang.org/x/tools/go/ast/astutil": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/go/ast/astutil: exit status 1 Fetching https://golang.org/x/tools/go/gcexportdata?go-get=1 Parsing meta tags from https://golang.org/x/tools/go/gcexportdata?go-get=1 (status code 200) get "golang.org/x/tools/go/gcexportdata": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/gcexportdata?go-get=1 get "golang.org/x/tools/go/gcexportdata": verifying non-authoritative meta tag package golang.org/x/tools/go/gcexportdata: cannot find package "golang.org/x/tools/go/gcexportdata" in any of: c:\go\src\golang.org\x\tools\go\gcexportdata (from $GOROOT) C:\Users\berth\go\src\golang.org\x\tools\go\gcexportdata (from $GOPATH) Fetching https://golang.org/x/lint/golint?go-get=1 Parsing meta tags from https://golang.org/x/lint/golint?go-get=1 (status code 200) get "golang.org/x/lint/golint": found meta tag get.metaImport{Prefix:"golang.org/x/lint", VCS:"git", RepoRoot:"https://go.googlesource.com/lint"} at https://golang.org/x/lint/golint?go-get=1 get "golang.org/x/lint/golint": verifying non-authoritative meta tag Fetching https://golang.org/x/lint?go-get=1 Parsing meta tags from https://golang.org/x/lint?go-get=1 (status code 200) golang.org/x/lint (download) Fetching https://golang.org/x/lint?go-get=1 Parsing meta tags from https://golang.org/x/lint?go-get=1 (status code 200) get "golang.org/x/lint": found meta tag get.metaImport{Prefix:"golang.org/x/lint", VCS:"git", RepoRoot:"https://go.googlesource.com/lint"} at https://golang.org/x/lint?go-get=1 Fetching https://golang.org/x/tools/go/ast/astutil?go-get=1 Parsing meta tags from https://golang.org/x/tools/go/ast/astutil?go-get=1 (status code 200) get "golang.org/x/tools/go/ast/astutil": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/ast/astutil?go-get=1 get "golang.org/x/tools/go/ast/astutil": verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) # cd C:\Users\berth\go\src\golang.org\x\tools; git pull --ff-only There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master package golang.org/x/tools/go/ast/astutil: exit status 1 Fetching https://golang.org/x/tools/go/gcexportdata?go-get=1 Parsing meta tags from https://golang.org/x/tools/go/gcexportdata?go-get=1 (status code 200) get "golang.org/x/tools/go/gcexportdata": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/gcexportdata?go-get=1 get "golang.org/x/tools/go/gcexportdata": verifying non-authoritative meta tag package golang.org/x/tools/go/gcexportdata: cannot find package "golang.org/x/tools/go/gcexportdata" in any of: c:\go\src\golang.org\x\tools\go\gcexportdata (from $GOROOT) C:\Users\berth\go\src\golang.org\x\tools\go\gcexportdata (from $GOPATH)
如何解决这个问题,因为我刚开始尝试 golang。
或者我应该忽略 vscode 的警告吗?
谢谢
解决方案
dejavuzhou/felix
有一个go.momd和go.sum:它依赖于go modules
因此请确保您的 VScode 使用 Go 1.11+ 和
- 没有
GOPATH
GO111MODULE
套装
(参见 troubleshooting)
正如评论:
- 将
GO111MODULE
设置为 Windows 系统环境变量中的值。 - 然后启动 VSCode,并在 Json 用户设置中将
go.toolsGopath
设置为一个新的空文件夹,专用于工具。 - 然后尝试在 VSCode 中构建您的项目,看看最初的错误消息是否仍然存在。
今天关于《安装依赖项导致 VS Code 安装失败》的内容就介绍到这里了,是不是学起来一目了然!想要了解更多关于的内容请关注golang学习网公众号!
声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
-
502 收藏
-
502 收藏
-
501 收藏
-
501 收藏
-
501 收藏
最新阅读
更多>
-
139 收藏
-
204 收藏
-
325 收藏
-
477 收藏
-
486 收藏
-
439 收藏
-
357 收藏
-
352 收藏
-
101 收藏
-
440 收藏
-
212 收藏
-
143 收藏
课程推荐
更多>
-
- 前端进阶之JavaScript设计模式
- 设计模式是开发人员在软件开发过程中面临一般问题时的解决方案,代表了最佳的实践。本课程的主打内容包括JS常见设计模式以及具体应用场景,打造一站式知识长龙服务,适合有JS基础的同学学习。
- 立即学习 542次学习
-
- GO语言核心编程课程
- 本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。
- 立即学习 508次学习
-
- 简单聊聊mysql8与网络通信
- 如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让
- 立即学习 497次学习
-
- JavaScript正则表达式基础与实战
- 在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。
- 立即学习 487次学习
-
- 从零制作响应式网站—Grid布局
- 本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。
- 立即学习 484次学习