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 2 years ago
  • Reactions: 1
  • Comments: 19 (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?

$ anchor build thread ‘main’ panicked at ‘Not in workspace.’, cli\src\lib.rs:750:47 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Getting this aswell 😞

anchor-cli 0.24.2 solana-cli 1.9.1 cargo 1.60.0

Any solutions or suggestions?

bro u need to pass anchor build from inside the dir u made by anchor init