Deploying Typescript Chaincodes Fail using DeployCC.sh In CLI Container for Test Network
Using the deployCC.sh script (https://github.com/hyperledger/fabric-samples/blob/main/test-network/scripts/deployCC.sh) from the cli container errors out because npm is not installed. Simple fix - apk add npm.
This fails at:
https://github.com/hyperledger/fabric-samples/blob/main/test-network/scripts/deployCC.sh#L82
Compiling TypeScript code into JavaScript...
/opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode-ts /peer
./scripts/deployCC.sh: line 72: npm: command not found
./scripts/deployCC.sh: line 73: npm: command not found
/peer
Finished compiling TypeScript code into JavaScript
Without this the chaincode is deployed improperly and you can easily miss the error message because I believe it tries to package up an empty chaincode package. Another feature that would be useful if the compile fails, the script should halt and not try to continue to publish a bad chaincode package.
This isn't only applicable to typescript, it also applies to Go and Java chaincode as well which require GoLang/Java to be installed otherwise deployment will fail.
It's not only an issue with the deploy script but also there is no mention of this in the docs or README for samples or test-network
Hey, @davidkel if faced the same while compiling the project on my local machine. I know where what changes are required. Can you assign me this issue? I have a past experience of writing articles.
@AyushRaj8271 I've assigned to you, thanks for working on a PR!