admin管理员组

文章数量:1302361

I cloned a rust project that compiled rust-analyzer to wasm for use in a monaco editor in browser, I was able to run the project locally and the pkg directory was generated succesfully using wasm-pack build --target web --profiling.

This is the Cargo.toml file

[package]
name = "wasm_demo"
version = "0.1.0"
authors = ["rust-analyzer developers"]
edition = "2018"

[lib]
crate-type = ["cdylib"]

[dependencies]
console_error_panic_hook = { version = "0.1.6" }
instant = { version = "0.1", features = ["wasm-bindgen"] }
log = { version = "0.4.14", features = ["release_max_level_warn"] }
serde = { version = "1.0.125", features = ["derive"] }
serde_repr = "0.1.6"
serde-wasm-bindgen = "0.1.3"
stacker = "0.1.13"
wasm-bindgen = "0.2.72"
wasm-bindgen-rayon = "1.0.2"

ide = { version = "0.0.81", package = "ra_ap_ide" }
cfg = { version = "0.0.81", package = "ra_ap_cfg" }
ide_db = { version = "0.0.81", package = "ra_ap_ide_db" }


[package.metadata.wasm-pack.profile.profiling]
wasm-opt = false

The issue I am encountering is that i tried adding another dependency to the Cargo.toml file for soroban-sdk support but I keep getting this error when i run wasm-pack build --target web --profiling

 wasm-pack build --target web --profiling
Error: `cargo metadata` exited with an error:     Updating crates.io index
error: no matching package named `soroban-sdk` found
location searched: registry `crates-io`
required by package `wasm_demo v0.1.0 (C:\Users\JIDE\Desktop\repos\rust-ide\ra-wasm)`

Caused by: `cargo metadata` exited with an error:     Updating crates.io index
error: no matching package named `soroban-sdk` found
location searched: registry `crates-io`
required by package `wasm_demo v0.1.0 (C:\Users\JIDE\Desktop\repos\rust-ide\ra-wasm)`

Here is my Cargo.toml after i added the soroban-sdk dependency

[package]
name = "wasm_demo"
version = "0.1.0"
authors = ["rust-analyzer developers"]
edition = "2018"

[lib]
crate-type = ["cdylib"]

[dependencies]
console_error_panic_hook = { version = "0.1.6" }
instant = { version = "0.1", features = ["wasm-bindgen"] }
log = { version = "0.4.14", features = ["release_max_level_warn"] }
serde = { version = "1.0.125", features = ["derive"] }
serde_repr = "0.1.6"
serde-wasm-bindgen = "0.1.3"
stacker = "0.1.13"
wasm-bindgen = "0.2.72"
wasm-bindgen-rayon = "1.0.2"
soroban-sdk = { version = "22.0.6" }  //Added this line

ide = { version = "0.0.81", package = "ra_ap_ide" }
cfg = { version = "0.0.81", package = "ra_ap_cfg" }
ide_db = { version = "0.0.81", package = "ra_ap_ide_db" }


[package.metadata.wasm-pack.profile.profiling]
wasm-opt = false

I am new to rust and can't figure out why I keep getting no matching package named soroban-sdk found because the soroban-sdk is present on crates.io

本文标签: rustError cargo metadata exited with an errorStack Overflow