开发者问题收集

Terra - 地形部署计数器 - 错误:命令失败:cp artifacts/counter{-aarch64,}.wasm

2022-03-31
178

我一直在关注 Terra CosmWasm 智能合约教程 ,并已采取所有概述的步骤(多次从头开始尝试、重新安装 Rust 等),但在使用地形部署命令时总是出现以下错误。

如果您能帮助我了解导致此错误的原因,我将不胜感激,我在网上搜索时找不到任何其他情况。提前致谢!

命令: terrain deploy counter --signer test1

错误:

using pre-baked 'test1' wallet on localterra as signer
    Finished release [optimized] target(s) in 0.07s
Running script 'optimize': 'docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/rust-optimizer:0.12.3
'
Info: RUSTC_WRAPPER=sccache
Info: sccache stats before build
Compile requests                      0
Compile requests executed             0
Cache hits                            0
Cache misses                          0
Cache timeouts                        0
Cache read errors                     0
Forced recaches                       0
Cache write errors                    0
Compilation failures                  0
Cache errors                          0
Non-cacheable compilations            0
Non-cacheable calls                   0
Non-compilation calls                 0
Unsupported compiler calls            0
Average cache write               0.000 s
Average cache read miss           0.000 s
Average cache read hit            0.000 s
Failed distributed compilations       0
Cache location                  Local disk: "/root/.cache/sccache"
Cache size                            0 bytes
Max cache size                       10 GiB
Building contract in /code ...
    Finished release [optimized] target(s) in 0.05s
Creating intermediate hash for counter.wasm ...
28087be6244b6ac0071f90002a5851f080c61c3212c2c4be348e01fcb54f97bb  ./target/wasm32-unknown-unknown/release/counter.wasm
Optimizing counter.wasm ...
Creating hashes ...
b410547cb1a425635024aa93be1e6324f5afae602528f6e98fefd6ed5dd47749  counter.wasm
Info: sccache stats after build
Compile requests                      0
Compile requests executed             0
Cache hits                            0
Cache misses                          0
Cache timeouts                        0
Cache read errors                     0
Forced recaches                       0
Cache write errors                    0
Compilation failures                  0
Cache errors                          0
Non-cacheable compilations            0
Non-cacheable calls                   0
Non-compilation calls                 0
Unsupported compiler calls            0
Average cache write               0.000 s
Average cache read miss           0.000 s
Average cache read hit            0.000 s
Failed distributed compilations       0
Cache location                  Local disk: "/root/.cache/sccache"
Cache size                            0 bytes
Max cache size                       10 GiB
done
Finished, status of exit status: 0
cp: missing destination file operand after 'artifacts/counter{-aarch64,}.wasm'
Try 'cp --help' for more information.
    Error: Command failed: cp artifacts/counter{-aarch64,}.wasm
    cp: missing destination file operand after 'artifacts/counter{-aarch64,}.wasm'
    Try 'cp --help' for more information.
3个回答

我搞明白了,我按照这里针对 M1 Mac 的说明进行操作: https://docs.terra.money/docs/develop/dapp/quick-start/using-terrain-localterra.html

nvm install --lts
nvm use --lts

然后使用此命令安装 Terrain,而不是 Terra Academy 视频(2022 年 4 月)中的命令: npm install -g @terra-money/terrain

Neel
2022-04-05

我之前遇到过完全相同的错误。 我认为您使用以下命令下载了地形。

npm install --global @iboss/terrain

我删除了这个包并使用了以下命令。

npm install --global @terra-money/terrain

我希望这会有所帮助。

Angel Brett
2022-04-26

不确定此问题是否已解决,但可能有一个可行的解决方案:

terrain deploy counter --signer bombay --network testnet

命令(或者我认为是 Terrain deploy counter --signer test1,我使用了上面的命令)

之后添加

--no-rebuild

Barry Alan
2022-04-17