anchor
anchor copied to clipboard
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
What is in the directory where you run anchor build
?
had the same thing go into the project folder my error changed but I still have this error
Failed to obtain package metadata:
cargo metadataexited with an error: error: failed to load manifest for workspace member
\?\C:\Users\kamal\Desktop\solana betting\solana-anchor-betting--game\myepicproject\programs*`
Caused by:
failed to read \\?\C:\Users\kamal\Desktop\solana betting\solana-anchor-betting--game\myepicproject\programs\*\Cargo.toml
Caused by: The filename, directory name, or volume label syntax is incorrect. (os error 123)`
I'm having the same error as @KnineVspython . I'm on Windows 11.
Also getting the "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" error while trying to run anchor build. I am running windows 11
@JoshuaBartels0311 can you clarify which anchor
version are you use? (otherwise line can be wrong)
@JoshuaBartels0311 can you clarify which
anchor
version are you use? (otherwise line can be wrong)
Hello! Yes, I'm using 0.20.0
Thanks for the quick reply! Can you also run RUST_BACKTRACE=full anchor build
?
facing the same issue on windows 11 and have WSL(ubuntu installed) , is there any workaround as of now ? "Failed to obtain package metadata:" Anchor version 0.23.0
I'm having the same error as @KnineVspython . I'm on Windows 11.
https://github.com/KnineVspython/buildspace-projects/blob/main/Solana_And_Web3/en/Section_2/Resources/windows_setup.md check this out man
facing same as @SkyCandy2 is facing i am running anchor-cli 0.21.0 in windows 10 please provide solution asap!
$ 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?
This backtrace is not so useful :( can you paste the backtrace for anchor cli build in debug mode?
$ 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 backtraceGetting 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
anchor doesn't like dashes in folder names. underscores are fine.
Hi guys, having this issue suddenly as well .... I have referred to previous links as well regarding rustc --version
, solana --version
as well... I'm not sure why this is happening suddenly as I have not had any issue for the past few months with other projects... Please help!
alright, found a work around with my current issue and that is to init
the new project in another current folder that anchor builds fine and turns out it works.... However, this should not be case right?
Getting this too!:
thread 'main' panicked at 'Not in workspace.', cli\src\lib.rs:801:15
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
tried running it in its build space but to no avail
just use cargo build
instead
Running into the same error