Search code examples
swift-package-managerkitura

swift package manager doesn't find KituraNet


I want to test Kitura, so I did

swift package init --type executable

I made a minimal Package.swift

import PackageDescription

let package = Package(
    name: "project2",
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        .package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from: "2.0.0")),
        .package(url: "https://github.com/IBM-Swift/HeliumLogger.git", .upToNextMinor(from: "1.7.1")),
        .package(url: "https://github.com/IBM-Swift/Kitura-StencilTemplateEngine", .upToNextMinor(from: "1.8.3"))
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages which this package depends on.
        .target(
            name: "project2",
            dependencies: ["Kitura", "HeliumLogger", "KituraStencil"]),
        ]
)

when I run swift build, the Error Message is

'Kitura' /Users/myname/Documents/myname/project2/.build/checkouts/Kitura.git-6522211175291160341: error: product dependency 'KituraNet' not found

I happened to do the exactly same thing on my desktop at work and everything was fine. Does anyone see what I am missing here?


Solution

  • You probably have a version mismatch. Try updating Kitura:

    .package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from: "2.3.0")),