Hyperledger fabric环境搭建中遇到的问题 Mac

开发者福利!热门AI工具限时免费用 购周边即赠Coding Plan Lite,Claude Code、Cursor等20+工具畅享,效率翻倍! 阅读详情

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_library

node-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 rebuild

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

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

Traceback (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 <module>
    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_main
    return 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 main
    return 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_main
    generator.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 GenerateOutput
    part_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 Write
    self.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 WriteSources
    cflags = 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 GetCflags
    archs = 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 GetActiveArchs
    xcode_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 GetXcodeArchsDefault
    xcode_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 XcodeVersion
    version = 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 ELIFECYCLE

npm 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下,再次启动即可。

mac 搭建第一个区块链网络 fabric 1.0-beta 花了快两天才搭好第一个区块链网络,踩过很多坑,有慢慢找到解决办法的,也有推到重来的。现在进入正题。    1 安装过程 1.1 安装brew           Linux不同版本的系统中有很多在线安装工具,如yum,apt-get。brew是mac中很实用的工具。 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.... 阅读详情

相关推荐

Hyperledger Fabric/Fabric-samples 安装及使用(Mac

1.清单 brew Git cUrl docker docker-compose GoLang 2.开始安装 2.1 Git mac自带git,也可自行安装:brew install git 2.2 curl brew install curl 2.3 docker brew install docker 2.4 docker-compose 无需操作,docker安装完成后,也含有了docker-compose 以上安装细节也可自行百度,网上都有^.^ 2.5 GoLang 1&

weixin_44681233的博客 1万+

关于 node-pre-gyp install --fallback-to-build 的解决办法

百度说是由于node源的问题,但笔者本身就是tb源。然后再重新跑一遍上面流程就可以了。今天刚开工,发现项目不能运行了。然后重新npm install。

全栈小菜鸟 6643

Mac Pro下部署Hyperledger Fabric 1.4.4

主要参考网址: https://www.jianshu.com/p/cd05e966a6a8 https://hyperledgercn.github.io/hyperledgerDocs/getting_started/ https://www.cnblogs.com/zongmin/p/11635686.html#autoid-0-3-1 https://www.jianshu.com...

yuxinqingge的博客 2173

`node-pre-gyp install --fallback-to-build`的解决办法

npm install -g node-gyp //windows sudo npm install -g node-gyp //linux

小码的博客 1万+

bcrypt 安装错误

Error npm ERR! code ELIFECYCLE npm ERR! errno 9009 npm ERR! bcrypt@5.0.0 install: `node-pre-gyp install --fallback-to-build` npm ERR! Exit status 9009 npm ERR! npm ERR! Failed at the bcrypt@5.0.0 install script. npm ERR! This is probably not a problem wi

qq_36965962的博客 1237

解决node-pre-gyp install --fallback-to-build 卡住不动

一般是因为需要下载国外的包,要么连VPN,要么使用淘宝的镜像: 使用cnpm: npm install -g cnpm --registry=https://registry.npm.taobao.org 然后用下面命令安装package.json: cnpm install

u011250186的博客 1万+

node.js错误 --> node-pre-gyp install --fallback-to-build

错误:node-pre-gyp install --fallback-to-build 问题描述:在安装ghost博客的时候需要使用node.js,但是在执行sudo npm install --production的时候报了这个错误 接着百度,看到https://github.com/node-inspector/v8-debug/issues/7github有同样问题了 我就选了一种试试...

Hitvz的博客 4万+

Hyperledger Fabric v2.2.x 搭建记录

fabricv2.2版本,bootstrap.sh文件,fabric安装问题,Ubuntu图标消失,Ubuntu设置消失,Ubuntu阿里源

weixin_43050394的博客 482

Mac OS 区块链hyperledger环境搭建环境架构介绍、环境如何用、部署 Chaincode、智能合约的调用

1. 环境搭建 Install Common Packages # install utilities $ brew install unzip $ brew install git $ brew install curl $ brew install wget $ brew install vim $ brew install tree $ brew install jq # install gradle $ cd /tmp && wget https://services.gra

AI架构师易筋 1256

安装fabric运行环境的时候Vagrant up遇到的问题,解决路径

解决方法来自: https://my.oschina.net/wtsoftware/blog/789164 搭建方法主要参考http://hyperledger-fabric.readthedocs.io/en/latest/dev-setup/devenv/的英文文档说明,和另一篇windows下的文章(http://8btc.com/article-3815-1.html)在mac

l18710006370的博客 2351

精通Hyperledgerfabric环境搭建-mac版(1.1)

为什么80%的码农都做不了架构师?>>> ...

weixin_34059951的博客 305

Fabric2.2.1搭建】过程及遇到的问题

Fabric2.2.1搭建搭建过程问题 搭建过程 在搭建过程中主要参考了两篇:①https://blog.csdn.net/glclh/article/details/108184471 这一篇操作讲的很细致,但是是1.4.0版的,我先是按着这个直接把版本号替换了,但是后面发现1.4.0和2.2.1在后续配置上有差别,就按照下面那篇了 ②https://blog.csdn.net/qq_43681877/article/details/110896678 问题 搭好环境后遇到了一下操作问题: ./netw

Moooonk的博客 8993

零基础入门指南:如何快速搭建build-blockchain-insurance-app本地开发环境

build-blockchain-insurance-app是一个基于Hyperledger Fabric的区块链保险应用示例,它展示了如何利用区块链技术处理保险理赔流程,涉及保险公司、警方、维修店和商店等多个参与方。本文将为你提供一个全面且简单的指南,帮助你快速搭建该项目的本地开发环境。 ## 了解项目架构 在开始搭建开发环境之前,让我们先了解一下build-blockchain-insur

gitblog_00201的博客 590

signature=bccf140f21d086e4f6b17e01edbac3a0,超级账本搭建流程fabric-sample first-network

超级账本搭建流程(全)参考:环境准备安装必要程序此安装流程仅介绍MAC系统,其他系统略有差别,请自行查看参考链接超级账本教程。- 执行如下命令:1. cd ~2. vi .bashrc3. 添加如下语句```export GOROOT=/usr/local/goexport GOPATH=$HOME/goexport PATH=$PATH:$GOROOT/bin:$GOPATH/bin```4. ...

weixin_32375369的博客 474

machyperledger fabric 2.X 搭建

写在前面,目前fabric官网文档教程已经比较完善了,不过搭建教程依旧不太完善,而且是英文,因此写下此篇分享给大家 一、环境准备 安装git brew install git 安装vim brew install vim 安装curl brew install curl 安装wget brew install wget 安装go1.14 以及以上版本 安装docker 17.06.2-ce 以及以上版本 安装docker-compose 1.14.0 以及以上版本 git 拉下 fabric 项目

smallone233的博客 1116

hyperledger fabric 源码调试(orderer)环境搭建教程

###前言 ​ 接触hyperledger fabric有一段时间了,看文档搭集群写链码都做过,但要深入理解还是通过源码比较直观,遂决定部署起来。同多机器部署一样,官文对源码调试的描述较少,网上有些前辈已经写过但少有明确每一步的原因,本系列文尝试依据个人理解来描述构建fabric源码调试环境的步骤,去掉docker这层障碍,并给出思考过程。 ​ 之前有写过一篇hyperledger fabric ...

beijihukk的博客 1730

Hyperledger fabric mac环境搭建

文档 安装cURL 安装docker and docker compose 下载docker 安装docker 测试docker 安装Homebrew 官网 安装命令 Go programming Language Node.js Runtime and NPM ...

//柏拉图的双斜杠 639

mac 安装 hyperledger fabric开发环境

参考文章https://www.jianshu.com/p/8beb3a355f990、安装docker0.1、安装gobrew install go1、go 的环境设置添加$GOPATH环境变量,在~/.bash_profile中添加:export GOPATH=/Users/frank/goexport PATH=$PATH:$GOPATH/bin2、建立 go 源码目录结构(必须要做,否则后...

frankxixu的专栏 2242

hyperledger fabric Mac环境配置

Step:官网文档 :https://hyperledger-fabric.readthedocs.io/en/latest/releases.html 1、安装docker for mac  2、安装cURL,  mac 环境中已经安装了cURL 3、安装docker and docker compose 4、安装Homebrew 官网: https://brew.sh/index_zh...

qq_41390321的博客 804
上一篇: Mac 通过安装node、nvm、nrm、yarn;macOS 13
下一篇: ITerm2+sshpass远程登录记住密码mac
grootblockchain
博客等级 码龄11年 54粉丝 101原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值