IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 开发工具 -> 记一次开发 pgadmin 时执行 Building the Web Assets 遇到的依赖安装问题 -> 正文阅读

[开发工具]记一次开发 pgadmin 时执行 Building the Web Assets 遇到的依赖安装问题

环境:

  • centos 7

问题描述:

项目的 package.json 的 dependencies 中有这样一个依赖:

"react-data-grid": "git+https://github.com/adityatoshniwal/react-data-grid.git/#1dc310dfaf5afea359404e867b7cf54953f47d1e",

按照 README.md 中 Building the Web Assets 在执行 make install-node 的时候报错如下:

(venv) [dangfulin@datanode pgadmin4]$ make install-node
cd web && yarn install
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads https://github.com/adityatoshniwal/react-data-grid.git/
Directory: /home/dangfulin/project/pgadmin4/web
Output:
fatal: 无法访问 'https://github.com/adityatoshniwal/react-data-grid.git/':Encountered end of file
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
make: *** [install-node] 错误 128

解决过程:

一,尝试从网络角度解决

1,查看是否能 ping 通 github

$ ping github.com
PING github.com (20.205.243.166) 56(84) bytes of data.
^C
--- github.com ping statistics ---
20 packets transmitted, 0 received, 100% packet loss, time 19001ms
  • 100% 丢包,完全不通,但 ping baidu.com 是没有问题的。

2,查询 github IP
访问 IPAddress.com 查询到 github 最新 IP 为 140.82.114.3
在这里插入图片描述
ping 一下,能通:

$ ping 140.82.114.3
PING 140.82.114.3 (140.82.114.3) 56(84) bytes of data.
64 bytes from 140.82.114.3: icmp_seq=1 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=2 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=3 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=4 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=5 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=6 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=7 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=8 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=9 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=10 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=11 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=12 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=13 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=14 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=15 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=16 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=17 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=18 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=19 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=20 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=21 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=22 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=23 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=24 ttl=44 time=281 ms
64 bytes from 140.82.114.3: icmp_seq=25 ttl=44 time=281 ms
^C
--- 140.82.114.3 ping statistics ---
25 packets transmitted, 25 received, 0% packet loss, time 24008ms
rtt min/avg/max/mdev = 281.373/281.514/281.787/0.100 ms

3,修改 hosts 文件
打开 /etc/hosts 文件添加地址映射:

140.82.114.3 github.com

4,刷新 DNS

$ yum install -y nscd
$ systemctl restart nscd

5,重启网络

$ systemctl restart network

6,再次 ping github,就能通了

$ ping github.com
PING github.com (140.82.114.3) 56(84) bytes of data.
64 bytes from github.com (140.82.114.3): icmp_seq=1 ttl=44 time=281 ms
64 bytes from github.com (140.82.114.3): icmp_seq=2 ttl=44 time=281 ms
64 bytes from github.com (140.82.114.3): icmp_seq=3 ttl=44 time=281 ms
64 bytes from github.com (140.82.114.3): icmp_seq=4 ttl=44 time=281 ms
64 bytes from github.com (140.82.114.3): icmp_seq=5 ttl=44 time=281 ms
64 bytes from github.com (140.82.114.3): icmp_seq=6 ttl=44 time=281 ms
64 bytes from github.com (140.82.114.3): icmp_seq=7 ttl=44 time=281 ms
64 bytes from github.com (140.82.114.3): icmp_seq=8 ttl=44 time=281 ms
^C
--- github.com ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7009ms
rtt min/avg/max/mdev = 281.438/281.574/281.797/0.547 ms

但实际上这解决不了问题 😃

二,直接 yarn 安装指定的依赖

还是不行:

(venv) [dangfulin@datanode pgadmin4]$ yarn install https://github.com/adityatoshniwal/react-data-grid.git/#1dc310dfaf5afea359404e867b7cf54953f47d1e
yarn install v1.22.19
error `install` has been replaced with `add` to add new dependencies. Run "yarn add https://github.com/adityatoshniwal/react-data-grid.git/#1dc310dfaf5afea359404e867b7cf54953f47d1e" instead.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
(venv) [dangfulin@datanode1 web]$ yarn add https://github.com/adityatoshniwal/react-data-grid.git/#1dc310dfaf5afea359404e867b7cf54953f47d1e
yarn add v1.22.19
[1/4] Resolving packages...
? https://github.com/adityatoshniwal/react-data-grid.git/#1dc310dfaf5afea359404e867b7cf54953f47d1e 
^C

3,用 yarn install 替换 make install-node

根据文档 README.md 的说法,我直接进入 web 目录下执行 yarn install,能成功:

(venv) [dangfulin@datanode pgadmin4]$ cd web && yarn install
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @material-ui/core@4.11.0" has incorrect peer dependency "react@^16.8.0".
warning " > @material-ui/core@4.11.0" has incorrect peer dependency "react-dom@^16.8.0".
warning "@projectstorm/react-diagrams > @projectstorm/react-diagrams-defaults@6.6.1" has incorrect peer dependency "@emotion/styled@^11.*".
warning " > aspen-decorations@1.1.1" has unmet peer dependency "aspen-core@^1.0.4".
warning " > context-menu@2.0.0" has incorrect peer dependency "react@^16.0.0".
warning " > context-menu@2.0.0" has incorrect peer dependency "react-dom@^16.0.0".
warning " > react-aspen@1.1.1" has incorrect peer dependency "react@^16.0.0".
warning " > react-aspen@1.1.1" has incorrect peer dependency "react-dom@^16.0.0".
warning " > snapsvg-cjs@0.0.6" has unmet peer dependency "eve@~0.5.1".
warning " > styled-components@5.3.3" has unmet peer dependency "react-is@>= 16.8.0".
warning " > tempusdominus-bootstrap-4@5.39.0" has incorrect peer dependency "tempusdominus-core@5.19.0".
warning " > url-loader@1.1.2" has incorrect peer dependency "webpack@^3.0.0 || ^4.0.0".
warning "@wojtekmaj/enzyme-adapter-react-17 > enzyme-adapter-utils@1.14.0" has incorrect peer dependency "react@0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0".
warning "@wojtekmaj/enzyme-adapter-react-17 > enzyme-adapter-utils > airbnb-prop-types@2.16.0" has incorrect peer dependency "react@^0.14 || ^15.0.0 || ^16.0.0-alpha".
warning " > istanbul-instrumenter-loader@3.0.1" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
warning " > karma-browserify@8.1.0" has unmet peer dependency "watchify@>=3 <5".
warning " > karma-requirejs@1.1.0" has unmet peer dependency "requirejs@^2.1.0".
warning " > svgo-loader@2.2.2" has incorrect peer dependency "svgo@^1.0.0".
[4/4] Building fresh packages...
Done in 71.87s.

(venv) [dangfulin@datanode pgadmin4]$ cd .. && make install-node
cd web && yarn install
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.41s.

已经成了。

然后执行 make bundle 就没有问题了:

(venv) [dangfulin@datanode pgadmin4]$ make bundle
cd web && yarn run bundle
yarn run v1.22.19
$ cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 yarn run bundle:dev
$ yarn run linter && yarn run webpacker
$ yarn eslint --no-eslintrc -c .eslintrc.js --ext .js  --ext .jsx .
$ /home/dangfulin/project/pgadmin4/web/node_modules/.bin/eslint --no-eslintrc -c .eslintrc.js --ext .js --ext .jsx .
$ yarn run webpack --config webpack.config.js --progress
$ /home/dangfulin/project/pgadmin4/web/node_modules/.bin/webpack --config webpack.config.js --progress
......
WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

webpack 5.61.0 compiled with 3 warnings in 26894 ms
Done in 96.62s.
  开发工具 最新文章
Postman接口测试之Mock快速入门
ASCII码空格替换查表_最全ASCII码对照表0-2
如何使用 ssh 建立 socks 代理
Typora配合PicGo阿里云图床配置
SoapUI、Jmeter、Postman三种接口测试工具的
github用相对路径显示图片_GitHub 中 readm
Windows编译g2o及其g2o viewer
解决jupyter notebook无法连接/ jupyter连接
Git恢复到之前版本
VScode常用快捷键
上一篇文章      下一篇文章      查看所有文章
加:2022-06-29 19:17:52  更:2022-06-29 19:18:45 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/14 15:14:45-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码