hyperledger-fabric“编写您的第一个应用程序" query.js步骤失败 [英] hyperledger-fabric "Writing your first Application" query.js step fails

查看:124
本文介绍了hyperledger-fabric“编写您的第一个应用程序" query.js步骤失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

步骤"git clone ...","startFabric.sh"和"npm.install"完成,没有错误. 节点query.js"结果为:

Steps "git clone...", "startFabric.sh" and "npm.install" complete with no errors. "node query.js" results in:

    Set wallet path, and associate user  PeerAdmin  with application
    error: [Client.js]: Failed to load user "PeerAdmin" from local key value store. Error: TypeError: this is not a typed array.
      at Function.from (native)
      at importKey (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:180:26)
      at fromString (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/User.js:228:28)
      at /home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/Client.js:968:22
    error: [Client.js]: Failed to load an instance of requested user "PeerAdmin" from the state store on this Client instance. Error: TypeError: this is not a typed array.
      at Function.from (native)
      at importKey (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:180:26)
      at fromString (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/User.js:228:28)
      at /home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/Client.js:968:22
   Caught Error [TypeError: this is not a typed array.]

注意:在git clone步骤之后,如文档中所述,fabric-samples/fabcar中没有"chaincode",但是fabric-samples中有chaincode/fabcar.这似乎没有引起问题. 注意:建立第一个网络"中的所有步骤都没有问题.

Note: after the git clone step, there is no "chaincode" in fabric-samples/fabcar as stated in the docs, but there is a chaincode/fabcar in fabric-samples. This does not seem to cause a problem. Note: All steps in "Building Your First Network" complete with no problems.

推荐答案

Hyperledger Fabric 1.0已针对Node.js版本> = 6.9和< 7.x.如果遇到类似错误,建议更新Node.js的版本(或使用版本管理器,例如nvm),然后重试.如果已经使用较旧版本的Node运行npm install,则应删除node_modules树并重新运行npm install,以确保安装了正确的依赖项.

Hyperledger Fabric 1.0 has been tested against Node.js version >= 6.9 and < 7.x. If you get a similar error, recommend updating the version of Node.js (or use a version manager such as nvm) and re-try. If you have already run npm install with an older version of Node, you should delete the node_modules tree and re-run npm install to be sure you are installing the correct dependencies.

这篇关于hyperledger-fabric“编写您的第一个应用程序" query.js步骤失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆