It fails because you must have used sudo cargo build first, which made the lock file belong to the root user. What you need to do is to copy your code somewhere else (which I think is just one file), sudo rm -r HelloWorld, then make a new project, copy back the code, and never again use sudo for any cargo command.