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
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 composer-cli@0.19.0
Can someone advice what to do?
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.
I had the same issues. And I solved it.
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
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.
- 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 composer-cli@0.19.0
$ 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
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.
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