步骤“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/