choco无法将choco识别_2.2 启动test_network遇到的问题及解决方案

本文介绍了在Windows环境下启动Docker Desktop时遇到的错误,包括Docker无法找到系统文件的问题,以及解决方法:先启动Hyper-V,再启动Docker。此外,还详细描述了在部署链码时由于golang.org无法访问导致的困难,通过安装和使用替代库glide进行编译,并解决了choco命令未被识别、安装make和配置glide mirrors.yaml的步骤,最终成功部署链码。
摘要由CSDN通过智能技术生成

一、启动test_network时报的错误

1. C:\Program Files\Docker\Docker\resources\bin\docker.exe: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/create: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running. 2. See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'. 3. error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/json?all=1: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

需要先启动Hyper-V

再启动Docker Desktop,这在重启电脑后容易忘记的两个步骤

二、部署链码时遇到golang.org官网国内不能访问的问题

google.golang.org/grpc/credentials: google.golang.org/grpc@v1.23.0: Get "https://proxy.golang.org/google.golang.org/grpc/@v/v1.23.0.zip": dial tcp 172.217.160.81:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

无奈只能试第三个方法,首先要安装glide,但由于glide 本身也有BUG,不适合国内的特殊情况,只能使用作者推荐的库:https://github.com/xkeyideal/glide,先下载

go get github.com/xkeyideal/glide

但使用这个库需要自行编译(make install),安装make install提示

bash: make: command not found

choco : 无法将“choco”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正

确,然后再试一次。

所在位置 行:1 字符: 1

choco install make

CategoryInfo : ObjectNotFound: (choco:String) [], CommandNotFoundException

FullyQualifiedErrorId : CommandNotFoundException

一层套一层的,还是要先安装choco,以管理员身份打开PoserShell,执行以下命令

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::Sec

测试是否安装成功,输入 choco

接着在powershell里安装make并测试是否安装成功

choco install make

make --v

最后把git base关闭再重新启动,进入$GOPATH/src/github.com/xkeyideal/glide 目录,执行

make install

测试是否正常

glide list

不报错说明已经安装成功

接着回到开头说的第三种方法,直接执行还是报错误

[INFO] No mirrors.yaml file exists. Creating new one

[ERROR] Error writing mirrors.yaml file: open C:\Users\Administrator.glide\mirrors.yaml: The system cannot find the path specified.

An Error has occurred

只能继续填坑,按报错信息在C:\Users\Administrator.glide目录下增加mirrors.yaml文件,内容为

注:.glide目录无法直接使用手工创建,只能先在cmd里使用 mkdir .glide 的命令来创建

然后再测试下:glide mirror list

上面的信息说明配置成功

最后执行

成功后输出

[INFO] mirrors.yaml written with changes

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值