错误:生成Angular 4应用程序时无法加载连接类型为“ hlfv1”的连接器模块“ composer-connector-hlfv1”

时间:2018-09-22 18:06:13

标签: hyperledger-composer

我在MacOS上关注this tutorial

在第5步, composer-rest-server 的输出:

Web server listening at: http://localhost:3000
Rest Server dynamic logging is enabled
Unhandled error for request GET /apple-touch-icon-precomposed.png: Error: Cannot GET /apple-touch-icon-precomposed.png

http://localhost:3000/explorer

Unhandled error for request GET /explorer: Error: Cannot GET /explorer

composer -v,composer-rest-server -v:v0.20.1

http://localhost:3000/status/

{"started":"2018-09-22T14:54:49.274Z","uptime":495.566}

在第六步:生成应用程序时,我收到错误消息:

$ yo hyperledger-composer:angular
Welcome to the Hyperledger Composer Angular project generator
? Do you want to connect to a running Business Network? Yes
? Project name: angular-app
? Description: Hyperledger Composer Angular project
? Author name: JPS
? Author email: jps
? License: Apache-2.0
? Name of the Business Network card: admin@tutorial-network
? Do you want to generate a new REST API or connect to an existing REST API?  Connect to an existing REST API
? REST server address: http://localhost
? REST server port: 3000
? Should namespaces be used in the generated REST API? Namespaces are not used
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: Failed to load connector module "composer-connector-hlfv1" for connection type "hlfv1". Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-darwin-x64-unknown
Found: [node-v59-darwin-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module '/usr/local/lib/node_modules/generator-hyperledger-composer/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node'-Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-darwin-x64-unknown
Found: [node-v59-darwin-x64-unknown]

我已经进行了 npm重建

1 个答案:

答案 0 :(得分:0)

我认为您的composer-client模块存在问题,只需将其卸载即可。

npm uninstall -g composer-cli@0.20

现在将其全局安装。确保您非root用户。在不使用sudo的情况下运行以下命令。

npm install -g composer-cli@0.20
  

注意 :这里我使用的是0.20版,请安装兼容版本。