这是我的
cargo.toml
文件
[package]
name = "thingspeak-example"
version = "0.1.0"
authors = ["Sergio Gasquez <[email protected]>"]
edition = "2021"
resolver = "2"
[profile.release]
opt-level = "s"
[profile.dev]
debug = true # Symbols are nice and they don't increase the size on Flash
opt-level = "z"
[features]
pio = ["esp-idf-sys/pio"]
[dependencies]
esp-idf-hal = "=0.38"
esp-idf-sys = { version = "=0.31.10", features = ["binstart"] }
esp-idf-svc = { version = "=0.42.5", features = ["experimental", "alloc"] }
embedded-svc = "=0.22"
anyhow = "1.0"
toml-cfg = "0.1"
log = "0.4.17"
# serde_json = "1.0.85"
serde = "1.0.144"
shared-bus = "0.2.4"
shtcx = "0.10.0"
cargo_toml = { version = "0.19.0-beta.1" }
[build-dependencies]
embuild = "0.30"
anyhow = "1"
每次我尝试运行它时都会收到以下错误:
Running `cargo build --bin=thingspeak-example --package=thingspeak-example --message-format=json --color=always`...
Updating crates.io index
error: failed to select a version for the requirement `cargo_toml = "^0.12"`
candidate versions found which didn't match: 0.20.5, 0.20.4, 0.20.3, ...
location searched: crates.io index
required by package `embuild v0.30.4`
... which satisfies dependency `embuild = "^0.30.4"` of package `esp-idf-sys v0.31.10`
... which satisfies dependency `esp-idf-sys = "=0.31.10"` of package `thingspeak-example v0.1.0 (/home/jteiland/thingspeak-example)`
if you are looking for the prerelease package it needs to be specified explicitly
cargo_toml = { version = "0.19.0-beta.1" }
Error: Cargo invocation failed.
at t.Cargo.getCargoArtifacts (/home/jteiland/.vscode-server/extensions/vadimcn.vscode-lldb-1.11.1/extension.js:1:10993)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.open (/home/jteiland/.vscode-server/extensions/vadimcn.vscode-lldb-1.11.1/extension.js:1:9296)
Caused by: Error: exit code: 101.
at ChildProcess.<anonymous> (/home/jteiland/.vscode-server/extensions/vadimcn.vscode-lldb-1.11.1/extension.js:1:12660)
at ChildProcess.emit (node:events:519:28)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)
如何解决此问题以确保我拥有正确的版本?
我已经尝试删除该文件并重新生成它。我也从头开始了
我想要运行的代码可以在这里
访问欢迎来到依赖地狱!首先,请从 Cargo.toml 中删除
cargo_toml = { version = "0.19.0-beta.1" }
。你可能把它放在那里是为了响应 Cargo 的建议,但这是一个方向错误的解决方案,因为需求来自你依赖的板条箱,而不是你自己的 Cargo.toml。
可能是出于安全考虑,0.14.0 之前的 Cargo_toml 箱版本已被删除。这使得所有依赖它们的板条箱都失败了。要再次构建项目,请更新依赖项,使其包含 embuild 0.31.1 或更高版本。您还需要至少更新 esp-idf-hal、esp-idf-sys 和 esp-idf-svc。
如果您遇到困难,您可能想看看代码的原作者是否可以提供帮助。在依赖项更新之前,他也将无法编译自己的代码。