anchor: Anchor build >> thread 'main' panicked at 'Not in workspace.'

Issue: Cannot get past this ‘Not in workspace’ issue. Can anyone help?

Terminal command: anchor build

Output: thread 'main' panicked at 'Not in workspace.', cli/src/lib.rs:701:47 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

From cli/src/lib.rs:701:47: 701. let cfg = Config::discover(cfg_override)?.expect("Not in workspace.");

Versions:

  • git version 2.30.1
  • solana-cli 1.9.1
  • anchor-cli 0.20.1
  • Node v16.13.2

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 1
  • Comments: 22 (5 by maintainers)

Commits related to this issue

Most upvoted comments

facing same as @SkyCandy2 is facing i am running anchor-cli 0.21.0 in windows 10 please provide solution asap!

What is in the directory where you run anchor build?

I can’t see that you used anchor init. In your case follow these steps:

  1. anchor init meu_projeto
  2. cd meu_projeto
  3. anchor build