找不到模块; Hyperledger结构教程

我正在尝试运行超级教程应用程序(fabcar)。

我已经遵循安装并尝试运行node query.js

我在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) 

我会很欣赏在debugging这个指针

问题是我在Python 3.6上运行。

我已经使用了:

 npm config set python python2.7 npm install --python=/usr/bin/python 

乃至

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

但问题是我这只是assumedpython2.7是在我的电脑,让我安装它。

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

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

  • 删除结构文件夹并再次下载
  • 创build一个Python 2.7的虚拟环境( conda create --name py2_env numpy python=2.7 (我使用anaconda发行版))
  • 运行npm install

现在工作正常