Ошибка: не удалось загрузить модуль соединителя "composer-connector-hlfv1" для типа соединения "hlfv1" при создании приложения Angular 4 - PullRequest
0 голосов
/ 22 сентября 2018

Я следую этому руководству на MacOS.

На шаге 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 голосов
/ 26 октября 2018

Я думаю, что есть проблема с вашим модулем composer-client, просто удалите его.

npm uninstall -g composer-cli@0.20

Теперь установите его как глобально.Убедитесь, что вы не пользователь root .Запустите приведенную ниже команду без sudo.

npm install -g composer-cli@0.20

Примечание : здесь я использую версию 0.20, установите совместимую версию.

...