I am writing this for those who will encounter this problem in the future. This solution led me to another problem but it does not give this error anymore. The problem is caused by the inability to isolate some files when working with more than one hyperledger fabric version. When I tracked the source of the error, I saw that the fabric-network folder in the node_modules folder caused this error. Because it is not used in Hyperledger Fabric v2.4 and later versions (https://www.npmjs.com/package/fabric-network) and Fabric Gateway needs to be used instead. If you delete the relevant folder or adjust your runtime environment accordingly, this problem will be solved.