Jenkins构建依赖问题

Jenkins构建过程中遇到失败,原因在于找不到特定版本的库文件。这通常是由于公司的私有nexus库未及时更新依赖导致。解决方法包括手动更新nexus依赖库,调整nexus自动更新时间,或者直接下载依赖库上传到nexus。已验证前两种方法可行,但可能需要一些时间。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

jenkins构建失败,查看构建日志,找到报错信息,部分内容粘贴如下:

npm WARN notsup Not compatible with your version of node/npm: less-loader@10.0.1
[0m[91mnpm WARN notsup Unsupported engine for style-loader@3.2.1: wanted: {"node":">= 12.13.0"} (current: {"node":"10.23.1","npm":"6.14.10"})
npm WARN notsup Not compatible with your version of node/npm: style-loader@3.2.1
[0m[91mnpm WARN notsup Unsupported engine for yargs@17.1.1: wanted: {"node":">=12"} (current: {"node":"10.23.1","npm":"6.14.10"})
npm WARN notsup Not compatible with your version of node/npm: yargs@17.1.1
[0m[91m
[0m[91mnpm ERR! code ETARGET
[0m[91mnpm ERR! notarget No matching version found for @babel/types@^7.15.4.
npm ERR! notarget[0m[91m In most cases you or one of your dependencies are requesting
npm ERR! [0m[91mnotarget a package version that doesn't exist.
npm ERR! notarget 
npm ERR! notarget[0m[91m It was specified as a dependency of '@babel/helper-module-imports'
npm ERR! notarget[0m[91m 
[0m[91m
npm ERR![0m[91m A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-09-03T10_04_40_582Z-debug.log
[0mThe command '/bin/sh -c npm install && npm ls vue vue-template-compiler && npm run build:prod' returned a non-zero code: 1
[Pipeline] }
[Pipeline] // withDockerRegistry
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE

从报错信息来看,很明显是找不到所需版本的库文件。
通常公司会通过nexus这类工具定期将服务所需的依赖库拉取下来,存储到自己的nexus等私库,当其他服务更新了依赖库或依赖库的官方最近进行更新了操作,可能会导致另外一个服务所需的相关的依赖库也需要更新,而此时如果nexus还未到更新时间,就会导致报错信息中提示的这类问题。

要解决这个问题其实很简单,有多种方法:

  • 要么手动更新nexus的依赖库
  • 要么临时调整nexus的自动更新时间
  • 要么把依赖库下载下来上传到nexus上
  • 要么调整远程代理的地址

其中第一种方法和第二种方法亲自实践过,有效,只是稍微需要点时间;其他方法上需各位自行实践

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值