"no such module 'PackageDescription'" when running swift package generate-xcodeproj

I just made sure to update to the latest (3.1.0) exercism, and tried to execute the ‘swift package’ command listed above. First, it gives me a warning that Xcode can open and build Swift Packages directly, and then it gave me this error:

Exercism/swift/leap/Package.swift:3:8: error: no such module 'PackageDescription'
import PackageDescription

How do I resolve this?

The exercise worked fine for me; I use Linux with exercism 3.1 and swift 5.7.

When you test, are you in the leap directory and running the command: swift test?

I’m not even to the point of testing. I am running the command indicated in the setup process to create the xcodeproj so I can open it in Xcode, and this is the error I get when I try.

You can’t open the files in xcode?

Well I wished I could help you. but I dont have an installtion of xcode on my machine. And thereby can’t help if you can’t accses the files.

But perhaps somebody else knows what this issue is?

I am just following the directions in the setup that said to run ‘swift package generate-xcodeproj’ after downloading the exercise. That was the error message that I got. I am stuck at that point.

hmmm, well what I do is that I download the exercise, solve the exercise and then I run swift test and that builds the exercise. Since you shouldn’t have to build the exercise before you actually have to test. But again I am not on a mac so it may be different

I am also stuck in the same issue. if someone know the answer it will be really helpful.

These days with the latest Xcode you can just open the Package.swift file and the whole project should open

That command should work though provided you have the latest Xcode downloaded