Search code examples
hyperledgerhyperledger-composer

Not able to install composer-cli on MAC


I am trying to install composer cli on my mac. npm says install was good:

Peeyushs-MacBook-Pro:fabric-dev-servers peeyush$ npm install -g composer-cli@0.20 --python=python2.7
/usr/local/bin/composer -> /usr/local/lib/node_modules/composer-cli/cli.js
/usr/local/lib
└── composer-cli@0.20.0

But when I try to run it, I get command not found:

Peeyushs-MacBook-Pro:fabric-dev-servers peeyush$ composer-cli
-bash: composer-cli: command not found

I am following this guide: https://hyperledger.github.io/composer/latest/installing/development-tools.html

Can you please help me figure out what is the issue here? TIA.


Solution

  • The command you want is composer not composer-cli. But you could still have problems. You have installed node into /usr (ie you installed it as root) and this can also lead to problems. In our documentation we highly recommend you don't do this but install node as your local user. We recommend using nvm for this. I highly suggest you follow our documentation to avoid hitting further issues. You should uninstall node first, then restart using nvm is the recommendation.