Search code examples
hyperledger-fabrichyperledger-composer

Unable to install Composer Cli


I am trying to install HyperLedger Composer in CentOS 7. I tried installing with sudo and without sudo. Its not working.

    [srisris@localhost fabric-tools]$ sudo npm install -g composer-cli
[sudo] password for srisris: 
npm WARN deprecated fs-promise@1.0.0: Use mz or fs-extra^3.0 with Promise Support
/usr/bin/composer -> /usr/lib/node_modules/composer-cli/cli.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/composer-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ composer-cli@0.19.1
updated 1 package in 23.255s
[srisris@localhost fabric-tools]$ npm config list
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/5.6.0 node/v9.11.0 linux x64"

; userconfig /home/srisris/.npmrc
prefix = "/home/srisris"

; node bin location = /usr/bin/node
; cwd = /home/srisris/hyperledger/fabric-tools
; HOME = /home/srisris
; "npm config ls -l" to show all defaults.

[srisris@localhost fabric-tools]$ npm ls -g --depth=0
/home/srisris/lib
├── node-gyp@3.6.2
└── rebuild@0.1.2

[srisris@localhost fabric-tools]$ 

Solution

  • Hyperledger Composer is supported for Mac and Ubuntu, but some people have it running on Centos.

    It looks like you have installed composer-cli with sudo, and it is installed under /usr/lib, BUT when you look for it using the npm ls -g -depth=0 command you are NOT using sudo and it is looking under /home/srisris/lib

    If you do sudo npm ls -g -depth=0 you should see it.

    Under Ubuntu it is recommended that you do not use sudo to install and run Composer. This link from the Composer Knowledge Wiki might help with any npm access issues.