设置工作空间:加载软件包…花费的时间太长了。

huangapple go评论84阅读模式
英文:

"Setting up workspace: Loading packages..." takes too long

问题

每次我在VSCode中打开项目文件夹时,它都会显示"设置工作区:正在加载包..."。如果我以非管理员身份运行VSCode(Windows 11),就会出现以下错误信息:

加载工作区时出错:1个模块存在错误:nuxt-fetch-bug:pattern nuxt-fetch-bug/...: 打开 C:\Users\username\AppData\Local\ElevatedDiagnostics 失败:拒绝访问。

我不明白这与nuxt有什么关系。我只是想打开包含单个文件main.go的文件夹。

最令人烦恼的是,在此错误结束之前,我无法保存文件,甚至无法编写代码,因为没有自动完成或其他功能。

英文:

Every time I open the project folder in VSCode, it starts with "Setting up workspace: Loading packages...". If I run VSCode not as Administrator (windows 11) it will end up with this message:

Error loading workspace: 1 modules have errors: nuxt-fetch-bug:pattern nuxt-fetch-bug/...: open C:\Users\username\AppData\Local\ElevatedDiagnostics: Access is denied.

I don't understand what it has to do with nuxt actually. I am trying to open the folder with the single file - main.go.

Most annoying part of this is that I can't save files until it is ended, or even write code, because there is no autocompletion or anything else.

答案1

得分: 3

该问题发生在打开没有 go.mod 文件的项目时。使用 go mod init example 命令可以解决该问题。

英文:

Damn, figured that out. This happens when you open the project that don't have go.mod file.

go mod init example solved the issue.

huangapple
  • 本文由 发表于 2022年10月22日 18:55:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/74162929.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定