truffle-dappchain-example
truffle-dappchain-example copied to clipboard
yarn serve:extdev => 'NETWORK' is not recognized as an internal or external command, operable program or batch file.
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
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...

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