2017-10-17 52 views
1

我想运行一个hyperledger教程应用程序(fabcar)。找不到模块; Hyperledger Fabric教程

我已按照安装并尝试运行node query.js

我得到终端这个错误:

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) 

我将在调试这个

回答

1

发行欣赏指针是我对Python的3.6运行。

我已经intially使用:

npm config set python python2.7 

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

甚至

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

但问题是我这只是assumed Python 2.7版是在我的电脑,让我来安装它​​。

当我运行node query.js命令时,​​仍然是一个未解决的依赖项。

为了解决这个问题,我不得不

  • 删除面料文件夹,并重新下载
  • 创建Python 2.7的虚拟环境(conda create --name py2_env numpy python=2.7(我用的是蟒蛇发行版))
  • 运行npm install

现在正常工作