I've been trying to follow the tutorials provided in https://www.anchor-lang.com/docs to build smart contracts. However when I try to use anchor build/anchor test, I am facing this error.
2 Answers
What's happening in reality, is that your workspace is in the wrong place.
As far as i can see you are using wsl, but the folder you are working is from a mounted drive. This mnt/c/users is the path of your windows folder. In order for your Anchor to work properly you will need to work in another path.
You will need to build in the home path per example. Example path: \wsl.localhost\Ubuntu-20.04\home\username\
This will fix this error.
Have a great day.