node.js - hyperledger-fabric "Writing your first Application"query.js 步骤失败

标签 node.js hyperledger-fabric

步骤“git clone...”、“startFabric.sh”和“npm.install”完成,没有错误。 “node query.js”结果:

    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 克隆步骤之后,fabric-samples/fabcar 中没有文档中所述的“chaincode”,但 Fabric-samples 中有一个 chaincode/fabcar。这似乎不会造成问题。 注意:“构建您的第一个网络”中的所有步骤均顺利完成。

最佳答案

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

关于node.js - hyperledger-fabric "Writing your first Application"query.js 步骤失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45174054/

相关文章:

javascript - 如何在环回资源管理器中隐藏 'id' 属性?

ldap - 使用 openldap 配置 hyperledger Fabric-CA 服务器

hyperledger-fabric - 在 Hyperledger Fabric 1.4 中存储非字符串

docker - 除非重新启动对等方,否则Hyperledger Composer无法更新

hyperledger-fabric - Fabric-client 模块的 CertificateAuthority 类中的 getCaName() 和 getName() 方法有什么区别?

node.js - 通过代理访问 azure redis 缓存

javascript - 使用express在node js中提供html文件

javascript - 编码URIComponent和内容类型: 'charset: utf-8'

hyperledger-fabric - Hyperledger Fabric GOSSIP_BOOTSTRAP & GOSSIP_EXTERNALENDPOINTS

javascript - 使用 phpStorm 将 js 文件合并为一个文件