AshT
AshT

Reputation: 545

No version of composer-cli has been detected

All,

After following the instructions in this page: Installing the Development Environment to install Hyperledger Composer, I encountered this error every time I use

sudo ./createPeerAdminCard.sh

enter image description here

I am sure that I have installed the correct version of composer-cli by executing these commands:

npm install -g composer-cli@next

or

npm install -g [email protected]

Can someone advice what to do?

Upvotes: 2

Views: 6156

Answers (5)

kamalnath L P
kamalnath L P

Reputation: 45

Just Remove sudo in prefix of the command. It worked fine for me

Upvotes: 0

Vipul Kumar Sharma
Vipul Kumar Sharma

Reputation: 69

I had the same issues. And I solved it.

  1. Follow the instructions in Installing pre-requisites.

    Very Important the link is below(I am using MacOS) : - https://hyperledger.github.io/composer/latest/installing/installing-prereqs.html

  2. After completing the above step destroy a previous setup

https://hyperledger.github.io/composer/latest/installing/development-tools.html#appendix

or

docker kill $(docker ps -q)
docker rm $(docker ps -aq)
docker rmi $(docker images dev-* -q)

run the above command.

  1. After this:-

Uninstalling the CLI tools ( 4 commands ):

$ npm uninstall composer-cli 
$ npm uninstall composer-rest-server 
$ npm uninstall -g generator-hyperledger-composer
$ npm uninstall -g yo

and installing them again

$ npm install -g [email protected]
$ npm install -g composer-rest-server
$ npm install -g generator-hyperledger-composer
$ npm install -g yo

After that all, check

composer -v.

You will get the required version of a composer. And the continue with the steps mentioned in https://hyperledger.github.io/composer/latest/installing/development-tools.html

Upvotes: 4

Mukesh Chapagain
Mukesh Chapagain

Reputation: 25996

In my case, I had to set the path variable for npm.

Run the following command:

npm config get prefix

This will give your npm path.

It can give something like: /usr/local/share/npm

Write the following command on your .bashrc or .bash_profile file or simply run the command on your terminal:

export PATH="/usr/local/share/npm/bin:$PATH"

After that:

  • open a new tab or window of the terminal
  • go to your fabric directory where you have the file createPeerAdminCard.sh
  • and run:

./createPeerAdminCard.sh

Now, it should run fine without the 'composer-cli not found' error.

Upvotes: 3

Philip Claesson
Philip Claesson

Reputation: 21

For anyone encountering this or related problems, note that the recommended Node version is currently 8.9.x only. See knowledge wiki.

My solution was:

nvm install 8.9.0

nvm use 8.9.0

npm install -g composer-cli

Upvotes: 2

R Thatcher
R Thatcher

Reputation: 5570

FYI the correct Install Doc for v0.19.0 of Composer is here

It looks like you are using sudo for some of the commands which may well be causing the problems. You should not need to use root or sudo. There is additional information in the the knowledge wiki about installing.

Upvotes: 2

Related Questions