当前位置: 首页 > news >正文

给银行做网站h5制作

给银行做网站,h5制作,企业网站管理系统 开源,做网站链接怎么做1、背景: 在维护paas云平台过程中,有研发反馈paas云平台上的CI/CD的前端流水线执行异常。 2、问题描述: 流水线执行的是前端编译,使用的是node.js环境。报错内容如下: 2024-07-18T01:23:04.203585287Z npm ERR! code E…

1、背景:

在维护paas云平台过程中,有研发反馈paas云平台上的CI/CD的前端流水线执行异常。

2、问题描述:

流水线执行的是前端编译,使用的是node.js环境。报错内容如下:

2024-07-18T01:23:04.203585287Z npm ERR! code ECONNRESET
2024-07-18T01:23:04.203727300Z npm ERR! errno ECONNRESET
2024-07-18T01:23:04.210147708Z npm ERR! network request to https://registry.npmjs.org/@vue%2fcli-plugin-router failed, reason: read ECONNRESET
2024-07-18T01:23:04.210195959Z npm ERR! network This is a problem related to network connectivity.
2024-07-18T01:23:04.210209224Z npm ERR! network In most cases you are behind a proxy or have bad network settings.
2024-07-18T01:23:04.210226834Z npm ERR! network 
2024-07-18T01:23:04.210338075Z npm ERR! network If you are behind a proxy, please make sure that the
2024-07-18T01:23:04.210441692Z npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
2024-07-18T01:23:04.232363448Z 
2024-07-18T01:23:04.232608727Z npm ERR! A complete log of this run can be found in:
2024-07-18T01:23:04.232720416Z npm ERR!     /root/.npm/_logs/2024-07-18T01_23_04_228Z-debug.log
2024-07-18T01:23:04.479748876Z 
2024-07-18T01:23:04.479882604Z > iot-platform-ui@0.0.1 build:test /app
2024-07-18T01:23:04.479934398Z > vue-cli-service build --mode test
2024-07-18T01:23:04.479958583Z 
2024-07-18T01:23:04.483348655Z sh: vue-cli-service: not found
2024-07-18T01:23:04.488652326Z npm ERR! code ELIFECYCLE
2024-07-18T01:23:04.488758492Z npm ERR! syscall spawn
2024-07-18T01:23:04.488835196Z npm ERR! file sh
2024-07-18T01:23:04.488841198Z npm ERR! errno ENOENT
2024-07-18T01:23:04.490957465Z npm ERR! iot-platform-ui@0.0.1 build:test: `vue-cli-service build --mode test`
2024-07-18T01:23:04.490990241Z npm ERR! spawn ENOENT
2024-07-18T01:23:04.490995027Z npm ERR! 
2024-07-18T01:23:04.490998423Z npm ERR! Failed at the iot-platform-ui@0.0.1 build:test script.
2024-07-18T01:23:04.491001883Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2024-07-18T01:23:04.492843295Z npm WARN Local package.json exists, but node_modules missing, did you mean to install?
2024-07-18T01:23:04.493174176Z 
2024-07-18T01:23:04.493206554Z npm ERR! A complete log of this run can be found in:
2024-07-18T01:23:04.493219813Z npm ERR!     /root/.npm/_logs/2024-07-18T01_23_04_491Z-debug.log

node.js编译的脚本配置如下: 

#!/bin/sh
# CMD 脚本执行的工作目录为 pipeline 基础镜像的文件系统目录,包含 clone 的代码
rm -rf /app/pkg/*
npm config set https://registry.npmmirror.com/

npm install
npm run build:test
result=$? #结果返回值
if [ $result -ne 0 ]; then
exit 1 #异常退出容器
fi

cp -r ./dist /app/pkg
cp nginx.conf /app/pkg

3、问题分析:

1、通过查看流水线执行的日志内容,npm ERR! network request to https://registry.npmjs.org/@vue%2fcli-plugin-router failed

2、初步分析是容器访问https://registry.npmjs.org地址有问题,需要在宿主机上执行telnet命令验证一下。

# ping registry.npmjs.org
PING registry.npmjs.org (104.16.0.35) 56(84) bytes of data.
64 bytes from 104.16.0.35 (104.16.0.35): icmp_seq=1 ttl=52 time=134 ms
64 bytes from 104.16.0.35 (104.16.0.35): icmp_seq=2 ttl=52 time=134 ms
64 bytes from 104.16.0.35 (104.16.0.35): icmp_seq=3 ttl=52 time=135 ms
^Z
[2]+  已停止               ping registry.npmjs.org# telnet registry.npmjs.org 443
Trying 104.16.0.35...
Connected to registry.npmjs.org.
Escape character is '^]'.

通过上面的网络检查手段,可以确认网络是通的。

3、再次查看node.js编译脚本的config配置是https://registry.npmmirror.com镜像地址。

4、所以得出结论是执行中使用的npm镜像地址和实际脚本配置的npm config地址对不上,导致报错了。

因为代码里的要求是使用淘宝的npm镜像地址的。

所以需要设置默认的npm镜像地址。 

npm config set registry https://registry.npmmirror.com

4、问题解决: 

node.js编译脚本中配置npm的默认镜像地址。设置后的node.js脚本配置内容如下:

#!/bin/sh
# CMD 脚本执行的工作目录为 pipeline 基础镜像的文件系统目录,包含 clone 的代码
rm -rf /app/pkg/*
npm config set registry https://registry.npmmirror.com/

npm install
npm run build:test
result=$? #结果返回值
if [ $result -ne 0 ]; then
exit 1 #异常退出容器
fi

cp -r ./dist /app/pkg
cp nginx.conf /app/pkg

再次执行CI/CD的流水线编译过程,最后执行成功了。

5、总结:

如果node.js在使用npm时,默认的镜像地址为:https://registry.npmjs.org/,但是这个地址是外国地址,基本是不通的,同时国内开发前端程序时,基本默认配置的淘宝的地址。

因此,大家在遇到这个错误时,可以参考如上的分析过程。

http://www.tj-hxxt.cn/news/127931.html

相关文章:

  • 吉林响应式网站建设seo零基础培训
  • 光明楼网站建设网络营销的策略
  • 北京做网站企业爱站关键词挖掘old
  • 秦皇岛公司做网站成都网络推广
  • 国内做网站最好的公司海外短视频跨境电商平台是真的吗
  • 网站建设网址网站制作市场营销考试题目及答案2022
  • 太原网站建设找山西云起时交换链接营销
  • 专业网站建设技术网站内部链接优化方法
  • 四川二级站seo整站优化排名域名年龄对seo的影响
  • 清新大气企业公司网站源码客服外包平台
  • cnzz站长统计怎么添加到博客网站网站开发报价方案
  • 网络规划设计师和网络工程师宁波seo推广服务电话
  • 网站建设的扩展性分析app推广公司怎么对接业务
  • wordpress 如何修改主题中元素搜索引擎seo关键词优化效果
  • 重庆电子工程职业学院招生网网站seo优化案例
  • 网站建设管理维护制度软件开发培训多少钱
  • 徐州做网站广东疫情中高风险地区最新名单
  • 自己做网站如何销售昆明seo网站建设
  • 建设部网站安全事故百度影音在线电影
  • 怎样做网站二维码佛山做网站的公司哪家好
  • 壹财富 网站开发上海seo培训中心
  • 做美食推广的网站销售营销方案100例
  • java做购物网站靠谱seo外包定制
  • 响应式网站设计图重庆森林电影高清在线观看
  • 机械类产品网站做优化郑州本地seo顾问
  • 杭州做网站多少钱优化游戏卡顿的软件
  • 网站做预览文档大连最好的做网站的公司
  • wordpress留言标签板自助建站seo
  • wordpress 更改首页优化seo是什么意思
  • 想制作一个网站要多少钱什么是互联网推广