使用Node.js SDK调用链码时出错[TypeError:无法读取未定义的属性'getConnectivityState' [英] Error invoking chaincode using Node.js SDK [TypeError: Cannot read property 'getConnectivityState' of undefined]
问题描述
无法成功调用:: TypeError:无法读取未定义的属性'getConnectivityState' /opt/share/hyperledger/node_modules/fabric-client/lib/EventHub.js:355 if(self._stream)state = self. stream.call.channel .getConnectivityState(); ^
Failed to invoke successfully :: TypeError: Cannot read property 'getConnectivityState' of undefined /opt/share/hyperledger/node_modules/fabric-client/lib/EventHub.js:355 if(self._stream) state = self.stream.call.channel.getConnectivityState(); ^
TypeError: Cannot read property 'getConnectivityState' of undefined
at ClientDuplexStream.<anonymous> (/opt/share/hyperledger/node_modules/fabric-client/lib/EventHub.js:355:56)
at emitOne (events.js:116:13)
at ClientDuplexStream.emit (events.js:211:7)
at ClientDuplexStream._emitStatusIfDone (/opt/share/hyperledger/node_modules/grpc/src/client.js:236:12)
at ClientDuplexStream._readsDone (/opt/share/hyperledger/node_modules/grpc/src/client.js:201:8)
at /opt/share/hyperledger/node_modules/grpc/src/client_interceptors.js:705:15
我正在使用以下链接中提到的必备软件的最新版本:
I am using latest version of pre-requisites as mentioned in below link:
有人可以告诉我我要去哪里错吗?
Can anybody tell me where am i going wrong?
推荐答案
是的,这是由于3天前发布了新版本的grpc(v1.11.0).该版本由fabric-client控制,并采用最新版本.您需要删除grpc模块,然后使用npm install grpc@1.9.1
重新安装它.这样可以解决问题.展望未来,在Hyperledger解决此问题之前,您可能需要在package.json中将grpc固定为1.9.1.
Yes, this is due to a new version of grpc released 3 days ago (v1.11.0). The version is controlled by fabric-client and it takes the latest available. You need to delete the grpc module and reinstall it with npm install grpc@1.9.1
. This will fix the issue. Going forward you may need to have grpc fixed at 1.9.1 in your package.json until Hyperledger resolve this issue.
参考: https://chat.hyperledger.org/channel/general?msg=FME6aDfnfMexWTm6g
这篇关于使用Node.js SDK调用链码时出错[TypeError:无法读取未定义的属性'getConnectivityState'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!