0

I have followed the instructions for setting up my windows based computer but when I try to initialize WebAssembly build environment from powershell with

make init

show this error:

./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

The init.sh file contain

#!/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

The installed toolchains seems to be fine

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)

I have read everything that google could bring with my queries but no solved it, so I would appreciate your help

Shawn Tabrizi
  • 12,206
  • 1
  • 38
  • 69
Adrian
  • 21
  • 4
  • 1
    Did you try just running the individual commands on your machine? In general my guess is that the BASH script does not work on windows. – Shawn Tabrizi Mar 16 '21 at 18:26
  • Of note: the devhub just got updated to use substrate v3 that deprecates the make file, and strongly suggests using WSL, not native windows, to develop: https://substrate.dev/docs/en/knowledgebase/getting-started/#1a-windows . Would you be willing to try it this way? We are able to support much more quickly and easily if so – Nuke Mar 16 '21 at 18:39
  • please start again with the node template v3.0.0 for best results while learning: https://github.com/substrate-developer-hub/substrate-node-template/tree/v3.0.0 – Nuke Mar 16 '21 at 18:40
  • @NukeManDan thanks for your support, i will to install WSL to see what happens. – Adrian Mar 16 '21 at 21:59
  • 1
    As @NukeManDan indicated, using WSL and the substrate node template V3, I already have the blockchain working. Thanks – Adrian Mar 17 '21 at 16:58
  • I've already answered this in https://stackoverflow.com/a/65489349/6819040 – AurevoirXavier Jul 07 '21 at 05:52

2 Answers2

0

From the comments:

Of note: the devhub just got updated to use substrate v3 that deprecates the make file, and strongly suggests using WSL, not native windows, to develop: substrate.dev/docs/en/knowledgebase/getting-started/#1a-windows .

This seems to be the best path for other windows users looking :)

Nuke
  • 1,032
  • 7
  • 13
0

Substrate development for windows is not properly supported.
Powershell and Command Prompt always give errors, what you can do is install WSL, then install Ubuntu and access the WSL from Visual Studio Code itself. Check out this article for detailed steps.

Rahul Soshte
  • 798
  • 8
  • 11