rddill-IBM / ZeroToBlockchain

Tutorial for Zero to Blockchain series
342 stars 924 forks source link

OSX Error Failed at the zerotoblockchain-network@0.1.6 prepublish script #27

Closed gnurtcouq closed 6 years ago

gnurtcouq commented 6 years ago

Hi Bob,

I follow your instruction n Chapter 3 in OSX:

npm install

It show error:

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! zerotoblockchain-network@0.1.6 prepublish: mkdirp ./network/dist && composer archive create --sourceType dir --sourceName . -a ./network/dist/zerotoblockchain-network.bna npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the zerotoblockchain-network@0.1.6 prepublish script.

When I checked , there is no zerotoblockchain-network.bna file created in

...//network/dist/

Please advice.

Thx,

Trung

rddill-IBM commented 6 years ago

It looks like you were not able to successfully execute the full setup script for this tutorial. Please run the following command and check for any errors during execution:

curl -H 'Accept: application/vnd.github.v3.raw' https://raw.githubusercontent.com/rddill-IBM/ZeroToBlockchain/master/setup_OSX.sh | bash
gnurtcouq commented 6 years ago

Thanks, Bob. It's working now.

I would like to add one more field in ITEM. (e.g. Status). Currently there are 4 fields:

Item Number Description Quantity Price

How can I achieve this?

Thanks.

rddill-IBM commented 6 years ago

Additional fields are defined in the network/model/sample.cto file and are populated in the network/lib/sample.js code (this is your chaincode).