执行createPeerAdminCard.sh脚本报错,寻求技术解决方案
createPeerAdminCard.sh Error with Composer Version @package_branch_alias_version@ (1.0.0-beta2) Hey there, let's tackle this error you're hitting when running createPeerAdminCard.sh for Hyperledger Fabric. That weird @package_branch_alias_version@ placeholder and the beta2 version mismatch are the main culprits here—here's how to fix it step by step:
Set the matching FABRIC_VERSION explicitly
The script defaults tohlfv11, but your Composer version (1.0.0-beta2) isn't compatible with that. For Composer 1.0.0-beta2, you need to usehlfv1. Run this command before executing the script:export FABRIC_VERSION=hlfv1Fix the Composer version placeholder issue
The@package_branch_alias_version@means the script isn't pulling the correct Composer version properly. Manually specify the exact version you're using:export COMPOSER_VERSION=1.0.0-beta2Adjust the startup timeout (optional but recommended)
The script assumes a 15-second timeout, but Fabric sometimes takes longer to spin up. Increase this to avoid timing out during setup:export FABRIC_START_TIMEOUT=30Re-run the script
With all variables set correctly, execute the script again:./createPeerAdminCard.shVerify the admin card was created
After running the script, confirm the card exists with:composer card listYou should see a card named
PeerAdmin@hlfv1listed if everything worked.
Extra Tips
- Make sure your Composer CLI version matches the one specified. If not, reinstall it with:
npm install -g composer-cli@1.0.0-beta2 - Double-check that all Fabric containers are running before running the script. Use
docker psto confirm you see containers for orderer, peer, couchdb, and certificate authority.
内容的提问来源于stack exchange,提问作者Prashanth Konda

