无法安装 Hyperledger composer-cli
Cannot install Hyperledger composer-cli
我开始按照这些 instructions 在 Hyperledger Composer 上构建应用程序,但是当我 运行:
$ ./createPeerAdminCard.sh
我明白了:
"Development only script for Hyperledger Fabric control
Running 'createPeerAdminCard.sh'
FABRIC_VERSION is unset, assuming hlfv11
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
No version of composer-cli has been detected, you need to install composer-cli at v0.19 or higher."
但是,我已经安装了它:
$ npm install -g composer-cli
我有:
+ composer-cli@0.19.2
added 568 packages from 473 contributors in 58.747s
请帮帮我!
你能试试这样设置 PATH
吗,
export PATH="/usr/local/share/npm/bin:$PATH"
完成后,尝试再次执行您的脚本,
$ ./createPeerAdminCard.sh
希望对您有所帮助!
nvm
应该为您管理您的路径,因此您不必担心这一点。值得首先检查您是否使用 nvm 安装了节点以及当前处于活动状态的版本
nvm ls
将显示安装的节点版本
nvm current
将显示当前激活的版本
如果它仍然不起作用,那么您需要检查您的 PATH 以查看是否存在正确的路径,如果不存在则手动添加。在您的情况下,正确的路径是
/home/arnaud/.nvm/versions/node/v8.11.1/bin
您还应该检查您使用的节点版本是否肯定是通过 nvm 安装的版本。
我以前也遇到过同样的问题。按照 Installing the development environment
中指定的所有步骤进行操作后
同时 运行宁 :
$ ./createPeerAdminCard.sh
我明白了:
"Development only script for Hyperledger Fabric control
Running 'createPeerAdminCard.sh'
FABRIC_VERSION is unset, assuming hlfv11
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
No version of composer-cli has been detected, you need to install composer-cli at v0.20 or higher."
解决方案略有不同。它可能对某人有用。实际上 .composer 目录的所有者被设置为 root 而不是登录用户。一旦我更改了所有者,命令 运行 就像魅力一样。
正如其他人所说,至少在 MacOS 中应该使用 nvm
。
安装 nvm
后,输入 $ nvm install v8.15.1
(或其他节点版本,但我相信 composer 需要 v8.x)。
在此之后,只需发出 npm install composer-cli
就可以了。
我开始按照这些 instructions 在 Hyperledger Composer 上构建应用程序,但是当我 运行:
$ ./createPeerAdminCard.sh
我明白了:
"Development only script for Hyperledger Fabric control
Running 'createPeerAdminCard.sh'
FABRIC_VERSION is unset, assuming hlfv11
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
No version of composer-cli has been detected, you need to install composer-cli at v0.19 or higher."
但是,我已经安装了它:
$ npm install -g composer-cli
我有:
+ composer-cli@0.19.2 added 568 packages from 473 contributors in 58.747s
请帮帮我!
你能试试这样设置 PATH
吗,
export PATH="/usr/local/share/npm/bin:$PATH"
完成后,尝试再次执行您的脚本,
$ ./createPeerAdminCard.sh
希望对您有所帮助!
nvm
应该为您管理您的路径,因此您不必担心这一点。值得首先检查您是否使用 nvm 安装了节点以及当前处于活动状态的版本
nvm ls
将显示安装的节点版本
nvm current
将显示当前激活的版本
如果它仍然不起作用,那么您需要检查您的 PATH 以查看是否存在正确的路径,如果不存在则手动添加。在您的情况下,正确的路径是
/home/arnaud/.nvm/versions/node/v8.11.1/bin
您还应该检查您使用的节点版本是否肯定是通过 nvm 安装的版本。
我以前也遇到过同样的问题。按照 Installing the development environment
中指定的所有步骤进行操作后同时 运行宁 :
$ ./createPeerAdminCard.sh
我明白了:
"Development only script for Hyperledger Fabric control
Running 'createPeerAdminCard.sh'
FABRIC_VERSION is unset, assuming hlfv11
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
No version of composer-cli has been detected, you need to install composer-cli at v0.20 or higher."
解决方案略有不同。它可能对某人有用。实际上 .composer 目录的所有者被设置为 root 而不是登录用户。一旦我更改了所有者,命令 运行 就像魅力一样。
正如其他人所说,至少在 MacOS 中应该使用 nvm
。
安装 nvm
后,输入 $ nvm install v8.15.1
(或其他节点版本,但我相信 composer 需要 v8.x)。
在此之后,只需发出 npm install composer-cli
就可以了。