jsonhyperledger-fabrichyperledgerhyperledger-composer

No composer.json found in the current directory


Hi guys, really sorry if this has a basic answer as I'm quite new to this. I am following a YouTube tutorial Hyperledger Composer Development Tutorial (2/5) - Modeling Language (Mac OS X) https://www.youtube.com/watch?v=S2S5cEcmx7Q&t=100s.

Following all steps up to 3:22 (and tutorial 1/5) I try to command:

composer archive create -a /dist/perishables.bna --sourceType dir --sourceName

Where the result should be:

Creating Business Network Archive


Looking for package.json of Business Network Definition
Input directory: /Users/joeheade/composer-sample-networks/packages/perishable-network

Found:
Description: Shipping Perishable Goods Business Network
Name: perishable-network
Identifier: perishable-network@0.1.11

Written Business Network Definition Archive file to 
Output file: ./dist/perishable-network.bna

Command succeeded

When I try, I get this:

Joe-Heades-MBP:perishable-network joeheade$ composer archive create -a /dist/perishables.bna --sourceType dir --sourceName


  [Symfony\Component\Console\Exception\RuntimeException]  
  The "-a" option does not exist.                         


archive [-f|--format FORMAT] [--dir DIR] [--file FILE] [--ignore-filters] [--] [<package>] [<version>]

If I check the version I get this:

Joe-Heades-MBP:perishable-network joeheade$ composer --version
Composer version 1.5.5 2017-12-01 14:42:57

And for a generic command, I get this:

Joe-Heades-MBP:perishable-network joeheade$ composer archive create
Searching for the specified package.
No composer.json found in the current directory, searching packages from packagist.org
Could not find a package matching create.

Please could somebody help? I'm also sorry if I'm following any Stack Overflow rules incorrectly; this is my first post.

Thank you in advance!

UPDATE: In addition if I take a step back I get this result for:

Joe-Heades-MacBook-Pro:dist joeheade$ compose archive create -a dist/perishables.bna --sourceType dir --sourceName
-bash: compose: command not found

Following the steps https://github.com/composer/composer/issues/6303, I also get the following response:

Joe-Heades-MacBook-Pro:perishable-network joeheade$ composer update
Composer could not find a composer.json file in /Users/joeheade/composer-sample-networks/packages/perishable-network
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

Solution

  • You've not installed Hyperledger Composer. You have installed something else called composer that also has a command line name of composer. Please refer to the documentation website https://hyperledger.github.io/composer/ for information about Hyperledger Composer and please ensure you uninstall the dependency manager for php (called composer).