热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Hyperledgerfabric环境搭建中遇到的问题Mac

1、node安装参考https:blog.csdn.netCaptainJavaarticledetails838668802、在搭建fabricIBMMarbles环境

1、node安装参考https://blog.csdn.net/CaptainJava/article/details/83866880

2、在搭建fabric IBM Marbles环境,在marbles/fabric-samples/fabcar下执行sudo npm install时node gyp安装报错

gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1

但是一直在找这个报错,也没有解决。其实是找错问题了,gyp固然是安装失败了 但是失败的原因在这个报错的前边几句,

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

当时报错为: 

~/go/src/marbles/fabric-samples/fabcar  ➦ 94c21eb  sudo npm install
Password:> grpc@1.14.2 install /Users/grootma/go/src/marbles/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_librarynode-pre-gyp WARN Using request for node-pre-gyp https download
[grpc] Success: "/Users/grootma/go/src/marbles/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/src/node/extension_binary/node-v48-darwin-x64-unknown/grpc_node.node" is installed via remote> pkcs11js@1.0.16 install /Users/grootma/go/src/marbles/fabric-samples/fabcar/node_modules/pkcs11js
> node-gyp rebuildxcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instancexcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instanceTraceback (most recent call last):File "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in sys.exit(gyp.script_main())File "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 545, in script_mainreturn main(sys.argv[1:])File "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in mainreturn gyp_main(args)File "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 523, in gyp_maingenerator.GenerateOutput(flat_list, targets, data, params)File "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2170, in GenerateOutputpart_of_all=qualified_target in needed_targets)File "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 795, in Writeself.Pchify))File "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1190, in WriteSourcescflags = self.xcode_settings.GetCflags(configname)File "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 551, in GetCflagsarchs = self.GetActiveArchs(self.configname)File "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 420, in GetActiveArchsxcode_archs_default = GetXcodeArchsDefault()File "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 118, in GetXcodeArchsDefaultxcode_version, _ = XcodeVersion()File "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1265, in XcodeVersionversion = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/bin/node" "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/grootma/go/src/marbles/fabric-samples/fabcar/node_modules/pkcs11js
gyp ERR! node -v v6.11.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
fabcar@1.0.0 /Users/grootma/go/src/marbles/fabric-samples/fabcar
└── (empty)npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none was installed.
npm WARN fabcar@1.0.0 No repository field.
npm ERR! Darwin 18.2.0
npm ERR! argv "/usr/local/Cellar/nvm/0.33.11/versions/node/v6.11.1/bin/node" "/usr/local/opt/nvm/versions/node/v6.11.1/bin/npm" "install"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLEnpm ERR! pkcs11js@1.0.16 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pkcs11js@1.0.16 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pkcs11js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pkcs11js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pkcs11js
npm ERR! There is likely additional logging output above.npm ERR! Please include the following file with any support request:
npm ERR! /Users/grootma/go/src/marbles/fabric-samples/fabcar/npm-debug.log
npm ERR! code 1

是xcode 命令行工具的问题,在这我们重新设置一下xcode路径就好了(后边路径要去确认一下自己的xcode路径)

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

注意:当时设置完了,接着执行npm install时报错了 新的错误,

/Applications/Xcode.app/Contents/Developer  sudo npm install
npm WARN enoent ENOENT: no such file or directory, open '/Applications/Xcode.app/Contents/Developer/package.json'
npm WARN Developer No description
npm WARN Developer No repository field.
npm WARN Developer No README data
npm WARN Developer No license field.

当时正好有事情就所有然见关掉,关机了,第二天打开电脑重新进行sudo npm install的时候结果成功了。没有在报错。所以肯呢个需要重启一下某些工具或者xcode。具体不清楚,反正我是重启电脑后就好了。。。如果有更好的解释或者更好的方法希望留言告知。

3、node install_chaincode.js 出现 Error('Cannot find org.', orgName):

root@xg:/opt/gopath/src/github.com/hyperledger/marbles/scripts# node install_chaincode.js 
info: Loaded config file /opt/gopath/src/github.com/hyperledger/marbles/config/marbles_local.json
info: Loaded connection profile file /opt/gopath/src/github.com/hyperledger/marbles/config/connection_profile_local.json

Connection Profile Lib Functions:()
......
  getAdminSignedCertPEM()
---------------------------------------
info: Lets install some chaincode - marbles v4
---------------------------------------
info: First we enroll
/opt/gopath/src/github.com/hyperledger/marbles/utils/connection_profile_lib/parts/org.js:102
        throw new Error('Cannot find org.', orgName);
        ^
Error: Cannot find org.

该问题是由于 marbles\config\connection_profile_local.json中的 hfc-key-store 的绝对路径不正确导致的,需要更改是实际路径

(解决方法参考的:https://blog.csdn.net/u011127242/article/details/83450015)

/Users/grootma/go/src/marbles/config/connection_profile_local.json文件中,三处"path"的值替换为Marble项目所在的绝对路径,只改前半部分后边不改动。即可。

4、在启动marbles服务,gulp marbles_local时报错

error: [Client.js]: Failed to load user "admin" from local key value store. Error: Error: Private key missing from key store. Can not establish the signing identity for user admin

错误,没找到admin用户的私钥,

将/Users/grootma/go/src/marbles/fabric-samples/fabcar/hfc-key-store文件夹下的文件复制到~/.hfc-key-store下,再次启动即可。


推荐阅读
  • imx6ull开发板驱动MT7601U无线网卡的方法和步骤详解
    本文详细介绍了在imx6ull开发板上驱动MT7601U无线网卡的方法和步骤。首先介绍了开发环境和硬件平台,然后说明了MT7601U驱动已经集成在linux内核的linux-4.x.x/drivers/net/wireless/mediatek/mt7601u文件中。接着介绍了移植mt7601u驱动的过程,包括编译内核和配置设备驱动。最后,列举了关键词和相关信息供读者参考。 ... [详细]
  • 安装mysqlclient失败解决办法
    本文介绍了在MAC系统中,使用django使用mysql数据库报错的解决办法。通过源码安装mysqlclient或将mysql_config添加到系统环境变量中,可以解决安装mysqlclient失败的问题。同时,还介绍了查看mysql安装路径和使配置文件生效的方法。 ... [详细]
  • javascript  – 概述在Firefox上无法正常工作
    我试图提出一些自定义大纲,以达到一些Web可访问性建议.但我不能用Firefox制作.这就是它在Chrome上的外观:而那个图标实际上是一个锚点.在Firefox上,它只概述了整个 ... [详细]
  • 安卓select模态框样式改变_微软Office风格的多端(Web、安卓、iOS)组件库——Fabric UI...
    介绍FabricUI是微软开源的一套Office风格的多端组件库,共有三套针对性的组件,分别适用于web、android以及iOS,Fab ... [详细]
  • Java String与StringBuffer的区别及其应用场景
    本文主要介绍了Java中String和StringBuffer的区别,String是不可变的,而StringBuffer是可变的。StringBuffer在进行字符串处理时不生成新的对象,内存使用上要优于String类。因此,在需要频繁对字符串进行修改的情况下,使用StringBuffer更加适合。同时,文章还介绍了String和StringBuffer的应用场景。 ... [详细]
  • 解决VS写C#项目导入MySQL数据源报错“You have a usable connection already”问题的正确方法
    本文介绍了在VS写C#项目导入MySQL数据源时出现报错“You have a usable connection already”的问题,并给出了正确的解决方法。详细描述了问题的出现情况和报错信息,并提供了解决该问题的步骤和注意事项。 ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 本文介绍了解决github无法访问和克隆项目到本地的问题。作者建议通过修改配置文件中的用户名和密码来解决访问失败的问题,并提供了详细步骤。同时,还提醒读者注意输入的用户名和密码是否正确。 ... [详细]
  • REVERT权限切换的操作步骤和注意事项
    本文介绍了在SQL Server中进行REVERT权限切换的操作步骤和注意事项。首先登录到SQL Server,其中包括一个具有很小权限的普通用户和一个系统管理员角色中的成员。然后通过添加Windows登录到SQL Server,并将其添加到AdventureWorks数据库中的用户列表中。最后通过REVERT命令切换权限。在操作过程中需要注意的是,确保登录名和数据库名的正确性,并遵循安全措施,以防止权限泄露和数据损坏。 ... [详细]
  • 本文介绍了pack布局管理器在Perl/Tk中的使用方法及注意事项。通过调用pack()方法,可以控制部件在显示窗口中的位置和大小。同时,本文还提到了在使用pack布局管理器时,应注意将部件分组以便在水平和垂直方向上进行堆放。此外,还介绍了使用Frame部件或Toplevel部件来组织部件在窗口内的方法。最后,本文强调了在使用pack布局管理器时,应避免在中间切换到grid布局管理器,以免造成混乱。 ... [详细]
  • 本文介绍了5个基本Linux命令行工具的现代化替代品,包括du、top和ncdu。这些替代品在功能上进行了改进,提高了可用性,并且适用于现代化系统。其中,ncdu是du的替代品,它提供了与du类似的结果,但在一个基于curses的交互式界面中,重点关注占用磁盘空间较多的目录。 ... [详细]
  • 本文介绍了在Android Studio中使用命令行build gradle的方法,并解决了一些常见问题,包括手动配置gradle环境变量和解决External Native Build Issues的方法。同时提供了相关参考文章链接。 ... [详细]
  • Redis的默认端口、数据库使用和多端口配置
    本文介绍了Redis的默认端口、数据库使用和多端口配置的方法。通过选择不同的数据库和使用flushdb命令可以实现对不同数据库的访问和清除数据。同时,本文还介绍了在同一台机器上启用多个Redis实例的方法,并讨论了配置认证密码的步骤和注意事项。 ... [详细]
  • 让你明白kvm是什么
    参考:https:blog.csdn.netbbwangjarticledetails80465320KVM工具集合:libvirt:操作和管理KVM虚机的虚拟化API ... [详细]
  • 本文整理了Java中io.fabric8.kubernetes.api.model.PodStatus.getConditions()方法的一些代码示例,展示了 ... [详细]
author-avatar
mobiledu2502895693
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有