我在做教程时遇到了这个错误。我无法解决问题。因此,我删除了该项目并创建了一个新的简单项目来解决问题,但仍然遇到同样的问题。我正在发布相关代码 -
package.swift 代码 -
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "dep",
products: [
.library(name: "dep", targets: ["App"]),
],
dependencies: [
// A server-side Swift web framework.
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),
// Swift ORM (queries, models, relations, etc) built on SQLite 3.
.package(url: "https://github.com/vapor/fluent-sqlite.git", from: "3.0.0"),
.package(url: "https://github.com/vapor/leaf.git", from: "3.0.0"),
],
targets: [
.target(name: "App", dependencies: ["Leaf","FluentSQLite", "Vapor"]),
.target(name: "Run", dependencies: ["App"]),
.testTarget(name: "AppTests", dependencies: ["App"])
]
)
当我在终端中执行“vapor build”并按 Enter 时,终端显示错误 - “”/Users/apple/dep: error: package at \'/Users/apple/dep\' is using Swift tools version 3.1.0 which不再支持;改用 4.0.0 或更新版本\n",输出:"")"
我已经完成了通常的工作,例如清理构建文件夹、清理派生数据等。现在,我接下来应该做什么。如果您需要更多信息,我可以发布代码或屏幕截图。