无法安装Composer Cli

时间:2018-04-16 13:44:45

标签: hyperledger-fabric hyperledger-composer

我正在尝试在CentOS 7中安装HyperLedger Composer。我尝试使用sudo安装而不使用sudo。它不起作用。

    [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]$ 

1 个答案:

答案 0 :(得分:0)

Hyperledger Composer支持Mac和Ubuntu,但有些人在Centos上运行它。

看起来你已经用sudo安装了composer-cli,它安装在/usr/lib下,但是当你使用npm ls -g -depth = 0命令查找它时你没有使用sudo和它正在寻找/home/srisris/lib

如果你sudo npm ls -g -depth=0,你应该看到它。

在Ubuntu下,建议您不要使用sudo来安装和运行Composer。来自Composer Knowledge Wiki的此链接可能有助于解决任何npm访问问题。