0

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
Jobajuba
  • 836
  • 7
  • 16
  • Does this answer your question? [How can a Rust program access metadata from its Cargo package?](https://stackoverflow.com/questions/27840394/how-can-a-rust-program-access-metadata-from-its-cargo-package) – Sweet Chilly Philly Apr 28 '22 at 02:34

1 Answers1

0

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

Jobajuba
  • 836
  • 7
  • 16