在“前端”docker 文件中运行 npm install 时,发生错误。
使用生产docker-compose 运行
如何重现问题
$docker pull node:13.1.0
$docker run -it -v ./frontent:/app --entrypoint bash node:13.1.0
``` root@container :/app# npm install
root@ac4c6f3a1914 :/app# npm install
npm WARN deprecated [email protected] : core-js@<3 不再维护,由于问题数量不推荐使用。 请将您的依赖项升级到core-js@3的实际版本
npm WARN 已弃用[email protected] :使用 String.prototype.padStart()
npm 错误! 执行时出错:
npm 错误! /usr/bin/git ls-remote -h -t git://github.com/adobe-webplatform/eve.git
npm 错误!
npm 错误! 致命:无法连接到 github.com:
npm 错误! github.com[0: 140.82.118.3]: errno=连接被拒绝
npm 错误!
npm 错误!
npm 错误! 退出错误代码:128
npm 错误! 可以在以下位置找到此运行的完整日志:
npm 错误! /root/.npm/_logs/2019-12-16T15_01_20_133Z-debug.log
OR run
``` root<strong i="33">@container</strong>:/app# yarn install
root<strong i="34">@ac4c6f3a1914</strong>:/app# npm install
yarn install v1.19.2
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
Directory: /app
Output:
fatal: unable to connect to github.com:
github.com[0: 140.82.118.3]: errno=Connection refused
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
为了规避这个问题,我发现使用
https://github.com/adobe-webplatform/eve.git
而不是git 'protocol' 工作即
git://github.com/adobe-webplatform/eve.git
但是,我不确定如何对此实施解决方案。
如果不是太难,我不介意朝正确的方向推动,如果这是一个真正的错误,我不介意提出 PR。
码头工人信息:
Client:
Debug Mode: false
Server:
Containers: 44
Running: 2
Paused: 0
Stopped: 42
Images: 60
Server Version: 19.03.5
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.184-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.855GiB
Name: docker-desktop
ID: xxxx-xxxx-xxxx-xxx-xxxx-xxx-xxx
Docker Root Dir: /var/lib/docker
Debug Mode: true
File Descriptors: 51
Goroutines: 66
System Time: 2019-12-16T15:22:47.5637998Z
EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
感谢您报告此问题。 似乎yarn.lock
问题是自动生成的。 我们无法配置它是yarn
错误或您的环境(网络等)问题。
@icoxfog417您是否能够在您的环境中成功运行此命令?
git ls-remote -h -t git://github.com/adobe-webplatform/eve.git
抱歉,这是我的防火墙问题。
我会关闭问题!
Atm 没有 URL git://github.com/adobe-webplatform/eve.git
,我们应该访问https
前缀。 解决方案是将git://github.com/adobe-webplatform/eve.git
所有https://github.com/adobe-webplatform/eve.git
doccano/frontend/yarn.lock
。
最有用的评论
抱歉,这是我的防火墙问题。
我会关闭问题!