truffle-dappchain-example icon indicating copy to clipboard operation
truffle-dappchain-example copied to clipboard

yarn serve:extdev => 'NETWORK' is not recognized as an internal or external command, operable program or batch file.

Open Swahgner opened this issue 3 years ago • 1 comments

When running yarn serve:extdev I'm getting the following output:

yarn run v1.22.18
$ NETWORK=extdev yarn run serve
'NETWORK' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I have followed all previous steps

Swahgner avatar May 09 '22 10:05 Swahgner

Looking at contract.js , NETWORK is an environmental variable...

    if (process.env.NETWORK == 'extdev') {
      return '9545242630824'
    }

So reading here: https://stackoverflow.com/questions/25112510/how-to-set-environment-variables-from-within-package-json

it appears on Windows you need to change line 15 of package.json to:

"serve:extdev": "set NETWORK=extdev&&yarn run serve",

using env instead of set didn't work for me.

After that it all seems to work...

image

Not sure why React and Webpack was used if this is the entire interface for the example?

robotzero1 avatar Jun 18 '22 13:06 robotzero1