1

After I installed solana-cli version 1.18.1, I tried to run the validator locally in the root directory but the command is not found. Did I miss something? My machine is a Mac M1.

(base) MacBook-Pro-126 ~ % solana --version      
solana-cli 1.18.1 (src:5d824a36; feat:756280933, client:SolanaLabs)
(base) MacBook-Pro-126 ~ % anchor --version
anchor-cli 0.29.0
(base) MacBook-Pro-126 ~ % solana config get
Config File: /Users/y/.config/solana/cli/config.yml
RPC URL: http://localhost:8899 
WebSocket URL: ws://localhost:8900/ (computed)
Keypair Path: /Users/y/.config/solana/id.json 
Commitment: confirmed 
(base) MacBook-Pro-126 ~ % solana-test-validator
zsh: command not found: solana-test-validator
1
  • solana-test-validator command worked fine before, but suddenly it doesn't work!
    – hanlong ye
    Commented May 21 at 10:22

2 Answers 2

1

Haven't faced this,

Try reinstalling/updating your CLI suite to 1.18.8 (recommended for anchor 0.30.0)

sh -c "$(curl -sSfL https://release.solana.com/stable/install)"

Installation guide https://solana.com/developers/guides/getstarted/setup-local-development#for-linux-macos-wsl-or-other-unix-like-systems

4
  • 1
    I installed it exactly according to this guide, but suddenly this command doesn't work and I don't know how to fix it anymore
    – hanlong ye
    Commented May 23 at 2:35
  • if it's crucial to use solana-test-validator, could you check out bankrun kevinheavey.github.io/solana-bankrun
    – Jimii
    Commented May 23 at 6:46
  • This seems to be only available for the JS client, do you know if it's possible to run test-validator by building a docker on MacOS?
    – hanlong ye
    Commented May 24 at 6:21
  • Haven't had the need to do this but check this out gist.github.com/beeman/6e52d53ddb45a353d0efe181d9c6e103 It downloads the CLI suite and should contains the test-validator in it.
    – Jimii
    Commented May 24 at 6:32
1

Did you install the Solana CLI using Homebrew? In that case, the test validator is not included.

Please install it manually, following these instructions:

https://docs.solanalabs.com/cli/install#macos--linux

Make sure it's in your PATH. The install script will notify you if a change is necessary.

The CLI has a solana-install command for updating or managing multiple versions, so it's a better choice than Homebrew.

3
  • I installed it manually and not using Homebrew,and I reused solana-install init 1.18.1 and the command still doesn't work
    – hanlong ye
    Commented May 23 at 2:33
  • OK that's weird. But just running solana works? Did you check the folder with the binaries (which solana to find it)?
    – ronnyhaase
    Commented May 23 at 6:49
  • Yes, solana is working fine, and I can find its binaries using which solana
    – hanlong ye
    Commented May 24 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.