在 Windows 10 中编译基板节点模板时出现基板开发中心错误

问题描述

我已经按照 instructions 设置了我的基于 Windows 的计算机,但是当我尝试从 Powershell 初始化 WebAssembly 构建环境时

make init

显示错误

./scripts/init.sh
process_begin: CreateProcess(NULL,env bash D:\Blockchain-substrate\substrate-node-template\scripts\init.sh,...) Failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:3: init] Error 2

init.sh 文件包含

#!/usr/bin/env bash

set -e

echo "*** Initializing WASM build environment ***"

if [ -z $CI_PROJECT_NAME ] ; then
    rustup update nightly
    rustup update stable
fi

rustup target add wasm32-unkNown-unkNown --toolchain nightly

安装的工具链似乎没问题

stable-x86_64-pc-windows-msvc
nightly-2020-10-01-x86_64-pc-windows-msvc
nightly-2021-03-15-x86_64-pc-windows-msvc
nightly-x86_64-pc-windows-msvc (default)

installed targets for active toolchain
--------------------------------------

wasm32-unkNown-unkNown
x86_64-pc-windows-msvc

active toolchain
----------------

nightly-x86_64-pc-windows-msvc (default)
rustc 1.52.0-nightly (107896c32 2021-03-15)

我已经阅读了谷歌可以为我的查​​询带来的所有内容,但没有解决,所以我很感激你的帮助

解决方法

来自评论:

注意:devhub 刚刚更新为使用弃用 make 文件的基板 v3,并强烈建议使用 WSL,而不是本机窗口来开发:substrate.dev/docs/en/knowledgebase/getting-started/#1a -窗口。

这似乎是其他 Windows 用户寻找的最佳途径:)

,

不正确支持 windows 的基板开发。
Powershell 和命令提示符总是会出错,您可以做的是安装 WSL,然后安装 Ubuntu 并从 Visual Studio Code 本身访问 WSL。 查看this article了解详细步骤。