模块版本不匹配composer-connector-hlfv1

时间:2017-07-25 20:51:48

标签: hyperledger-composer

在浏览开发人员指南教程时,我一直收到“模块版本不匹配”错误。我能够完成几乎所有的教程(创建和测试我的业务网络,将其部署到本地结构,通过其余服务器与它进行交互),但在运行yeoman创建示例角度应用程序时出错...

~/git/my-test-network$ 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: my-app
? Description: Commodity
? Author name: t
? Author email: t
? License: Apache-2.0
? Business network identifier: my-test-network
? Connection profile: hlfv1
? Enrollment ID: admin
? Enrollment secret: adminpw
? Do you want to generate a new REST API or connect to an existing REST API?         Generate a new REST API
? REST server port: 4000
? Should namespaces be used in the generated REST API? Never use namespaces
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: Failed to load connector module "composer-connector-hlfv1" for connection profile "hlfv1". Error: Module version mismatch. Expected 48, got 46.
at connectionProfileStore.load.then.e (/usr/local/lib/node_modules/generator-hyperledger-composer/node_modules/composer-common/lib/connectionprofilemanager.js:150:38)

我相信这与npm有关,但我已经多次卸载/重新安装/重建并且错误仍然存​​在

npm uninstall -g composer-cli
npm uninstall -g composer-rest-server
npm uninstall -g generator-fabric-composer
npm install -g composer-cli
npm install -g composer-rest-server
npm install -g generator-fabric-composer
npm uninstall -g yo
npm install -g yo

我的设置......

Ubuntu 16.04.1 LTS

docker --version    Docker version 17.06.0-ce, build 02c1d87
docker-compose --version    docker-compose version 1.8.0, build unknown
node --version  v6.11.1
npm --version   5.3.0

npm -v composer-cli 5.3.0
npm -v composer-rest-server 5.3.0
npm -v generator-hyperledger-composer   5.3.0
npm -v yo 5.3.0

1 个答案:

答案 0 :(得分:0)

请检查composer -v

的输出

你应该使用generator-hyperledger-composer上面我看到你安装了旧版本:npm install -g generator-fabric-composer

是否可以cd加入生成的应用和rm -r node_modules目录,然后重新运行npm install