Update Jenkinsfile

This commit is contained in:
木鱼和金鱼 2026-01-22 15:30:48 +08:00 committed by GitHub
parent f5d579f1a6
commit dfb92123d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

5
Jenkinsfile vendored
View File

@ -27,6 +27,11 @@ pipeline {
steps { steps {
echo '构建项目...' echo '构建项目...'
sh ''' sh '''
# 此时 node/npm 已经在 PATH 中了
echo "Node 版本: $(node --version)"
echo "NPM 版本: $(npm --version)"
# 后续构建命令...
# 直接使用 Jenkins 全局环境中的 Node.js # 直接使用 Jenkins 全局环境中的 Node.js
if ! command -v node >/dev/null 2>&1; then if ! command -v node >/dev/null 2>&1; then
echo "❌ 错误: 没有在 PATH 中找到 node 命令" echo "❌ 错误: 没有在 PATH 中找到 node 命令"