title: "解决 Waiting for File Lock on Package Cache Lock"
date: 2021-02-03T20:46:38+08:00
draft: true
tags: ['rust','cargo']
author: "dadigang"
author_cn: "大地缸"
personal: "http://www.real007.cn"
关于作者
解决 waiting for file lock on package cache lock
PS F:\rustprj\guessing_game> cargo run
Blocking waiting for file lock on package cache
cargo build(cargo run一样的)时,出现上述问题。添加了新的依赖后,出现上述问题。然后尝试了网上的方法。确定没有多个程序占用,并且先尝试了powershell设置代理方法。并没有解决,然后删了~/.cargo/.package-cache
文件后得到解决。
PS F:\rustprj\guessing_game> cd C:\Users\28328\.cargo\
PS C:\Users\28328\.cargo> ls
目录: C:\Users\28328\.cargo
---- ------------- ------ ----
d----- 2020/4/14 9:10 bin
d----- 2020/4/14 11:02 registry
-a---- 2020/4/14 8:58 0 .package-cache
PS C:\Users\28328\.cargo> rm .\.package-cache
PS F:\rustprj\guessing_game> cargo build
Updating crates.io index
Downloaded rand v0.5.6
Downloaded rand_core v0.3.1
Downloaded winapi v0.3.8
Downloaded rand_core v0.4.2
Downloaded winapi-x86_64-pc-windows-gnu v0.4.0
Compiling winapi-x86_64-pc-windows-gnu v0.4.0
Compiling winapi v0.3.8
Compiling rand_core v0.4.2
Compiling rand_core v0.3.1
Compiling rand v0.5.6
Compiling guessing_game v0.1.0 (F:\rustprj\guessing_game)
Finished dev [unoptimized + debuginfo] target(s) in 52.67s
网友评论