【问题标题】:Can't install anchor for Solana. AVM gives error again and again无法为 Solana 安装锚。 AVM 一次又一次地给出错误
【发布时间】:2022-11-09 16:35:27
【问题描述】:

我想安装锚点,并且我的 PC 中安装了 avm,但我一直处于错误循环中。 自己看——

我正在尝试使用命令avm 使用最新它给了我错误-

PS C:\Windows\system32> avm use latest
Version 0.25.0 is not installed, no current version.
Error: You need to run 'avm install 0.25.0' to install it before using it.
PS C:\Windows\system32>

所以我尝试安装 -avm 安装最新现在给我 -

PS C:\Windows\system32> avm install latest
    Updating git repository `https://github.com/coral-xyz/anchor`
warning: skipping duplicate package `swap` found at `C:\Users\asus\.cargo\git\checkouts\anchor-50c4b9c8b5e0501f\6baed77\tests\swap\programs\swap`
warning: skipping duplicate package `shared` found at `C:\Users\asus\.cargo\git\checkouts\anchor-50c4b9c8b5e0501f\6baed77\tests\typescript\programs\shared`
warning: skipping duplicate package `shared` found at `C:\Users\asus\.cargo\git\checkouts\anchor-50c4b9c8b5e0501f\6baed77\tests\zero-copy\programs\shared`
     Ignored package `anchor-cli v0.25.0 (https://github.com/coral-xyz/anchor?tag=v0.25.0#6baed77e)` is already installed, use --force to override
Error: The system cannot find the file specified. (os error 2)
PS C:\Windows\system32>

现在我再次尝试使用以下代码 -锚安装最新的--force或者avm 安装 0.25.0现在它又给了我与上面相同的错误-

PS C:\Windows\system32> avm install latest --force
    Updating git repository `https://github.com/coral-xyz/anchor`
warning: skipping duplicate package `swap` found at `C:\Users\asus\.cargo\git\checkouts\anchor-50c4b9c8b5e0501f\6baed77\tests\swap\programs\swap`
warning: skipping duplicate package `shared` found at `C:\Users\asus\.cargo\git\checkouts\anchor-50c4b9c8b5e0501f\6baed77\tests\typescript\programs\shared`
warning: skipping duplicate package `shared` found at `C:\Users\asus\.cargo\git\checkouts\anchor-50c4b9c8b5e0501f\6baed77\tests\zero-copy\programs\shared`
     Ignored package `anchor-cli v0.25.0 (https://github.com/coral-xyz/anchor?tag=v0.25.0#6baed77e)` is already installed, use --force to override
Error: The system cannot find the file specified. (os error 2)
PS C:\Windows\system32>

我正在管理员的 Windows PowerShell 中执行此操作,并且我尝试删除该位置的文件 -C:\Users\asus.cargo\git\checkouts没有什么变化。 它只是先安装它,然后给出它已经安装的相同错误。 我也尝试卸载并重新安装 avm 但没有任何改变 怎么能解决这个错误。帮助!! 先感谢您 。

【问题讨论】:

    标签: anchor solana anchor-solana


    【解决方案1】:

    不幸的是,AVM 不是为在 Windows 上使用而设计的,因此您需要运行 cargo uninstall avm 然后 cargo install --git https://github.com/project-serum/anchor --tag v0.25.0 anchor-cli --lockedv0.25.0 替换为您想要的版本。我希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2020-02-18
      • 2013-04-27
      • 1970-01-01
      • 1970-01-01
      • 2022-11-09
      • 1970-01-01
      • 1970-01-01
      • 2021-08-23
      • 1970-01-01
      相关资源
      最近更新 更多