使用货物在Windows上安装Anchor-CLI

发布于 2025-01-24 18:19:36 字数 423 浏览 3 评论 0原文

在Windows上安装了Anchor-CLI,但是当我尝试查看版本时,我会收到此消息。我认为我不应该在全球安装它。

Only x86_64 / Linux distributed in NPM package right now.
Trying globally installed anchor.
Could not find globally installed anchor, install with cargo.

此问题是否本地化在使用的标签参数中(-tag V0.24.1),如果是,我应该使用旧版本吗?命令用于安装锚

cargo install --git https://github.com/project-serum/anchor --tag v0.24.1 anchor-cli --locked

Installed anchor-cli on windows, but when I try to view the version I get this message. I don't think that I should be installing this globally.

Only x86_64 / Linux distributed in NPM package right now.
Trying globally installed anchor.
Could not find globally installed anchor, install with cargo.

Is this issue localised in the tag argument used (--tag v0.24.1) and if so, should I use an older version? Command used to install anchor

cargo install --git https://github.com/project-serum/anchor --tag v0.24.1 anchor-cli --locked

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北方。的韩爷 2025-01-31 18:19:36

尝试在没有 - 标签

cargo install --git https://github.com/project-serum/anchor anchor-cli --force

替代方案的情况下安装锚点:在管理模式下打开PowerShell或CMD。
键入“ Winver”以检查您的OS版本。
您需要Windows 10及更高版本才能为Linux安装Windows子系统。

在Windows上启用WSL:
在您的搜索栏上,输入

打开或关闭Windows功能

并查找

linix的Windows子系统

可以选中该框以打开它
然后单击“确定”以保存设置。

通过在管理模式下在CMD或PowerShell上运行此命令来启用WSL:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

它将告诉您是否需要重新启动系统,但无论如何都可以重新启动。

下一步:
去Microsoft商店搜索

linux

并安装您喜欢的软件包

ubuntu

安装后

,再次重新启动系统。下一步:
打开您刚刚安装的Ubuntu应用程序。
这将安装一些其他软件包。
选择您的新用户名和密码,然后将其写下来,您会记住的地方。
密码将不可见,因此请确保没有错误。
按Enter,您现在将看到输出。

下一步:
打开Vscode并打开并打开新的WSL终端并使用此命令

”在此处输入图像说明”
sudo apt-get Update&& sudo apt-get升级& amp; amp; sudo apt-get安装-y pkg-config build-esential libudev-dev

Try installing anchor without the --tag

cargo install --git https://github.com/project-serum/anchor anchor-cli --force

Alternative: Open Powershell or CMD in admin mode.
Type "winver" to check your OS version.
You need Windows 10 and above to install Windows Subsystem for Linux.

Enable WSL on Windows:
On you search bar, type

Turn windows features on or off

and find

Windows Subsystem for Linix

enter image description here

can check the box to turn it on
and click "OK" to save the settings.

Enable WSL by running this command on CMD or Powershell in admin mode:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

It will tell you if you need to restart your system, but restart anyway.

Next step:
Go to the Microsoft store and search for

linux

and install your prefered package

Ubuntu

After the installation, restart your system again.

Next step:
Open the Ubuntu application your just installed.
This will install some further packages.
Choose your new username and password and write it down somewhere you'll remember.
The password will not be visible so make sure there are no mistakes.
Press Enter and you will now see the output.

Next Step:
Open Vscode and open and open a new wsl terminal and install anchor using this command

enter image description here
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文