我跟着tutorial for glide usage。
我做了glide init
并成功创建了glide.yaml
。发布时,当我glide update
时,我发现错误。我知道如何解决这个问题?
我使用glide
go get github.com/Masterminds/glide
注意:我正在Windows
通过Git Bash
终端进行这些操作。
(不确定,但如果需要GOPATH
值,则为/c/Users/aagoyal/eclipse-workspace-oxygen/GoPath/:/d/Edge_OSS/code/microservice/NE3SProto/
。我的代码位于/d/DAAAS/Edge_OSS/code/microservice/NE3SProto/src/ne3s
}
$ glide update
[INFO] Downloading dependencies. Please wait...
[INFO] --> Fetching updates for github.com/gorilla/mux
[INFO] Resolving imports
[INFO] --> Fetching updates for github.com/gorilla/context
[INFO] Downloading dependencies. Please wait...
[INFO] Setting references for remaining imports
[INFO] Exporting resolved dependencies...
[INFO] --> Exporting github.com/gorilla/context
[INFO] --> Exporting github.com/gorilla/mux
[INFO] Replacing existing vendor dependencies
[ERROR] Unable to export dependencies to vendor directory: Error moving files: exit status 1. output: Access is denied.
0 dir(s) moved.
答案 0 :(得分:0)
就我而言,在自动构建环境中的Windows上运行Glide时,我遇到了相同的错误。将文件从Glide使用的临时目录移动到最终的供应商目录中似乎是一个问题。
对我来说,我可以通过覆盖GLIDE_TMP
环境变量来解决该问题,使其位于项目的build目录中。因此,根据您的情况,您可以尝试将GLIDE_TMP
变量设置为项目目录附近的工作目录,或者使用glide --tmp value
参数作为每个Glide命令的一部分仅执行一次
例如(假设Bash终端):
GLIDE_TMP=/d/DAAAS/Edge_OSS/code
glide update
或
glide --tmp /d/DAAAS/Edge_OSS/code update
如果该临时目录不起作用,您可以尝试将/d/DAAAS/Edge_OSS/code/microservice/NE3SProto/src/ne3s
项目目录用作临时目录,在这种情况下,Glide会在那里临时创建一个随机的glide-vendor1234567
子目录,直到将文件保存到vendor
。