简体   繁体   English

找不到模块; Hyperledger Fabric 教程

[英]Cannot find module ; Hyperledger Fabric Tutorial

I am trying to run a hyperledger tutorial app (fabcar).我正在尝试运行一个超级账本教程应用程序 (fabcar)。

I have followed the install and try to run node query.js .我已经按照安装并尝试运行node query.js

I get this error on terminal:我在终端上收到此错误:

module.js:529
    throw err;
    ^

Error: Cannot find module '/Users/pro/Documents/Code/HyperLegderFabric/fabric-samples/fabcar/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64/grpc_node.node'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/pro/Documents/Code/HyperLegderFabric/fabric-samples/fabcar/node_modules/grpc/src/node/src/grpc_extension.js:30:15)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)

I will appreciate pointers in debugging this我会很感激调试这个的指针

Issue was I was running on python 3.6 .问题是我在 python 3.6 上运行。

I have intially used:我最初使用过:

npm config set python python2.7

npm install --python=/usr/bin/python

and even乃至

sudo npm install --unsafe-perm  -g --python=python2.7

but the problem was I this just assumed python 2.7 was on my pc, allowed me to install it.但问题是我只是assumed python 2.7 在我的电脑上,允许我安装它。

When I ran the node query.js command, grpc_node.node was still a dependency that wasnt resolved.当我运行node query.js命令时, grpc_node.node仍然是一个未解决的依赖项。

To solve this, I had to为了解决这个问题,我不得不

  • Delete the fabric folder and download it again删除fabric文件夹并重新下载
  • Create a python 2.7 virtual environment ( conda create --name py2_env numpy python=2.7 (I use the anaconda distro))创建一个 python 2.7 虚拟环境( conda create --name py2_env numpy python=2.7 (我使用的是 anaconda 发行版))
  • Run npm install运行npm install

Works fine now现在工作正常

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Dropbox Api 教程“错误:找不到模块” - Dropbox Api Tutorial “Error: Cannot find module” 错误:在 adminbro 教程中找不到模块“tslib” - Error: Cannot find module 'tslib' on adminbro tutorial Hyperledger:找不到模块grpc_node.node错误 - Hyperledger: Cannot find module grpc_node.node error hyperledger-fabric教程中的致命错误; 潜在的不兼容问题 - Fatal error in hyperledger-fabric tutorial; potential incompatibility problems 无法为angular-phonecat教程进行npm安装:找不到模块&#39;update-notifier&#39; - Cannot npm install for angular-phonecat tutorial : Cannot find module 'update-notifier' 错误响应主体中的属性`message`无法访问| 超级账本面料 - Property `message` in error response body cannot be accessed | Hyperledger Fabric 运行超级账本结构项目时无法读取未定义的属性“曲线” - Cannot read property 'curve' of undefined, while running hyperledger fabric project Hyperledger Fabric - 无法调用交易 - 背书失败 - Hyperledger Fabric - Cannot invoke a transaction - Endorsement has failed 无法找到在 Fabcar 示例中注册管理员所需的模块 - Hyperledger Fabric - Unable to find modules required to enroll admin in Fabcar example - Hyperledger fabric 寻找一个端到端教程,以使用Hyperledger Fabric和Composer REST SERVER开发NodeJs区块链应用程序 - Looking for a End-to-End tutorial to develop a NodeJs Blockchain Appliation using Hyperledger Fabric and Composer REST SERVER
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM