Skip to content

Commit 93e2d53

Browse files
authored
fix: "Dist" step failed in Jenkins with ELSPROBLEMS (#2831)
The "Dist" step in the release process in Jenkinsfile was failing with npm ERR! code ELSPROBLEMS npm ERR! missing: @babel/cli@^7.8.4, required by [email protected] ... ditto for every *dev* dependency ... The part that was actually failing was 'npm ls --omit=dev --all --parseable' in "gen-notice.sh" when run in a dist try that only has the non-dev deps installed. The issue was a too-old npm: node 16.15.0 includes npm 8.5.5, but we require npm v8.7.0 to get support for 'npm ls --omit=dev ...' (npm/cli#4744).
1 parent c293164 commit 93e2d53

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.ci/Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pipeline {
1616
NOTIFY_TO = '[email protected]'
1717
NPMRC_SECRET = 'secret/jenkins-ci/npmjs/elasticmachine'
1818
TOTP_SECRET = 'totp/code/npmjs-elasticmachine'
19-
BUILD_NODE_VERSION = 'v16.15.0'
19+
BUILD_NODE_VERSION = 'v16.15.1'
2020
DOCKER_REGISTRY = 'docker.elastic.co'
2121
DOCKER_SECRET = 'secret/apm-team/ci/docker-registry/prod'
2222
}

dev-utils/gen-notice.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@ DIST_DIR="$1"
5353
[[ -n "$DIST_DIR" ]] || fatal "missing DIST_DIR argument"
5454
[[ -f "$DIST_DIR/package.json" ]] || fatal "invalid DIST_DIR: $DIST_DIR/package.json does not exist"
5555

56-
# Guard against accidentally using this script with a too-old npm.
57-
if [[ $(npm --version | cut -d. -f1) -lt 8 ]]; then
56+
# Guard against accidentally using this script with a too-old npm (<v8.7.0).
57+
npmVer=$(npm --version)
58+
npmMajorVer=$(echo "$npmVer" | cut -d. -f1)
59+
npmMinorVer=$(echo "$npmVer" | cut -d. -f2)
60+
if [[ $npmMajorVer -lt 8 || ($npmMajorVer -eq 8 && $npmMinorVer -lt 7) ]]; then
5861
if [[ "$LINT_MODE" == "true" ]]; then
59-
warn "npm version is too old for 'npm ci --omit=dev': $(npm --version)"
62+
warn "npm version is too old for 'npm ci --omit=dev': $npmVer"
6063
exit 0
6164
fi
62-
fatal "npm version is too old for 'npm ci --omit=dev': $(npm --version)"
65+
fatal "npm version is too old for 'npm ci --omit=dev': $npmVer"
6366
fi
6467

6568
# Directory holding some "license.*.txt" files for inclusion below.

0 commit comments

Comments
 (0)