gpt4 book ai didi

node.js - enrolladmin.js 的 Hyperledger Fabric Fabcar 错误

转载 作者:太空宇宙 更新时间:2023-11-04 03:22:48 24 4
gpt4 key购买 nike

我已启动 Fabric 脚本,然后运行 ​​enrolladmin.js 文件。

Node enrolladmin.js

但出现以下错误。如何解决?

node enrollAdmin.js
fs.js:904
return binding.readdir(pathModule._makeLong(path), options.encoding);
^

Error: ENOENT: no such file or directory, scandir '/Users/jaspalsingh/fabric-samples/fabcar/node_modules/grpc/src/node/extension_binary'
at Object.fs.readdirSync (fs.js:904:18)
at Object.<anonymous> (/Users/jaspalsingh/fabric-samples/fabcar/node_modules/grpc/src/grpc_extension.js:37:23)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/jaspalsingh/fabric-samples/fabcar/node_modules/grpc/src/client.js:38:12)

最佳答案

我也遇到了同样的问题。只需通过以下步骤解决即可:

  1. 创建目录: /node_modules/grpc/src/node/extension_binary/
  2. 中执行“npm install”
  3. 中执行“npm 重建”

第 2 步或第 3 步 - 其中一个应该可以解决问题 - 按相同的顺序尝试。

在第 2 步或第 3 步之后 - 您应该会看到一个文件。 /node_modules/grpc/src/node/extension_binary/node-v46-linux-x64-glibc/grpc_node.node

之后,注册管理员应该成功,如下所示:

sprint @ fabcar>node enrollAdmin.js
Store path:/home/ravir/hl/fabric-samples/fabcar/hfc-key-store
Successfully enrolled admin user "admin"
Assigned the admin user to the fabric client ::{"name":"admin","mspid":"Org1MSP","roles":null,"affiliation":"","enrollmentSecret":"","enrollment":{"signingIdentity":"42d8536072cf7e47358c137b254d78d8e853934caee70d03dbec06a22f482ad9","identity":{"certificate":"-----BEGIN CERTIFICATE-----\}

如果你仔细观察,startFabric.sh 的输出会打印

"

Start by installing required packages run 'npm install'
Then run 'node enrollAdmin.js', then 'node registerUser'

"

关于node.js - enrolladmin.js 的 Hyperledger Fabric Fabcar 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48285041/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com