Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release fails in make-distribution.sh step #3968

Closed
trentm opened this issue Apr 11, 2024 · 0 comments · Fixed by #3969
Closed

release fails in make-distribution.sh step #3968

trentm opened this issue Apr 11, 2024 · 0 comments · Fixed by #3969
Assignees

Comments

@trentm
Copy link
Member

trentm commented Apr 11, 2024

% ./dev-utils/make-distribution.sh
elastic-apm-node-4.5.1.tgz
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: eslint-plugin-import@2.29.1
npm ERR! Found: eslint@9.0.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^9.0.0" from the root project
npm ERR!   peer eslint@"^6.0.0 || ^7.0.0 || >=8.0.0" from @eslint-community/eslint-utils@4.4.0
npm ERR!   node_modules/@eslint-community/eslint-utils
npm ERR!     @eslint-community/eslint-utils@"^4.2.0" from eslint@9.0.0
npm ERR!     @eslint-community/eslint-utils@"^4.1.2" from eslint-plugin-es-x@7.5.0
npm ERR!     node_modules/eslint-plugin-es-x
npm ERR!       eslint-plugin-es-x@"^7.5.0" from eslint-plugin-n@16.6.2
npm ERR!       node_modules/eslint-plugin-n
npm ERR!         dev eslint-plugin-n@"^16.0.1" from the root project
npm ERR!     1 more (eslint-plugin-n)
npm ERR!   5 more (eslint-compat-utils, eslint-config-prettier, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" from eslint-plugin-import@2.29.1
npm ERR! node_modules/eslint-plugin-import
npm ERR!   dev eslint-plugin-import@"^2.28.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint@8.57.0
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" from eslint-plugin-import@2.29.1
npm ERR!   node_modules/eslint-plugin-import
npm ERR!     dev eslint-plugin-import@"^2.28.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/trentm/.npm/_logs/2024-04-11T18_51_48_500Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/trentm/.npm/_logs/2024-04-11T18_51_48_500Z-debug-0.log

With TRACE=1:

SUMMARY
% TRACE=1 ./dev-utils/make-distribution.sh
./dev-utils/make-distribution.sh:13: set -o errexit
./dev-utils/make-distribution.sh:14: set -o pipefail
.../dev-utils/make-distribution.sh:25: dirname ./dev-utils/make-distribution.sh
../dev-utils/make-distribution.sh:25: cd ./dev-utils/../
../dev-utils/make-distribution.sh:25: pwd
./dev-utils/make-distribution.sh:25: TOP=/Users/trentm/el/apm-agent-nodejs4
./dev-utils/make-distribution.sh:26: BUILD_DIR=/Users/trentm/el/apm-agent-nodejs4/build/dist
../dev-utils/make-distribution.sh:29: npm --version
../dev-utils/make-distribution.sh:29: cut -d. -f1
./dev-utils/make-distribution.sh:29: [[ 9 -lt 8 ]]
./dev-utils/make-distribution.sh:33: rm -rf /Users/trentm/el/apm-agent-nodejs4/build/dist
./dev-utils/make-distribution.sh:34: mkdir -p /Users/trentm/el/apm-agent-nodejs4/build/dist
./dev-utils/make-distribution.sh:35: cd /Users/trentm/el/apm-agent-nodejs4/build/dist
./dev-utils/make-distribution.sh:37: mkdir -p nodejs/node_modules/elastic-apm-node
./dev-utils/make-distribution.sh:38: cd nodejs/node_modules/elastic-apm-node
./dev-utils/make-distribution.sh:40: npm --loglevel=warn pack /Users/trentm/el/apm-agent-nodejs4
elastic-apm-node-4.5.1.tgz
./dev-utils/make-distribution.sh:41: tar --strip-components=1 -xf elastic-apm-node-4.5.1.tgz
./dev-utils/make-distribution.sh:42: rm elastic-apm-node-4.5.1.tgz
./dev-utils/make-distribution.sh:43: cp /Users/trentm/el/apm-agent-nodejs4/package-lock.json ./
./dev-utils/make-distribution.sh:47: npm ci --omit=dev --ignore-scripts
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: eslint-plugin-import@2.29.1
npm ERR! Found: eslint@9.0.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^9.0.0" from the root project
npm ERR!   peer eslint@"^6.0.0 || ^7.0.0 || >=8.0.0" from @eslint-community/eslint-utils@4.4.0
npm ERR!   node_modules/@eslint-community/eslint-utils
npm ERR!     @eslint-community/eslint-utils@"^4.2.0" from eslint@9.0.0
npm ERR!     @eslint-community/eslint-utils@"^4.1.2" from eslint-plugin-es-x@7.5.0
npm ERR!     node_modules/eslint-plugin-es-x
npm ERR!       eslint-plugin-es-x@"^7.5.0" from eslint-plugin-n@16.6.2
npm ERR!       node_modules/eslint-plugin-n
npm ERR!         dev eslint-plugin-n@"^16.0.1" from the root project
npm ERR!     1 more (eslint-plugin-n)
npm ERR!   5 more (eslint-compat-utils, eslint-config-prettier, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" from eslint-plugin-import@2.29.1
npm ERR! node_modules/eslint-plugin-import
npm ERR!   dev eslint-plugin-import@"^2.28.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint@8.57.0
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" from eslint-plugin-import@2.29.1
npm ERR!   node_modules/eslint-plugin-import
npm ERR!     dev eslint-plugin-import@"^2.28.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/trentm/.npm/_logs/2024-04-11T18_52_43_741Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/trentm/.npm/_logs/2024-04-11T18_52_43_741Z-debug-0.log

peerDeps were broken in the recent update to eslint@9. We didn't notice because we have this at the top-level:

% cat .npmrc
# Workaround unresolvable peerDependencies between graphql, @apollo-server,
# and apollo-server-express. npm v7 (included with node v15) makes these
# peerDependencies issues an install error. Until the community catches up
# and resolves peerDependencies issues or apm-agent-nodejs.git's tests are
# setup to not have competing deps in "devDependencies", we revert to the
# pre-v7 behavior.
# https://docs.npmjs.com/cli/v7/using-npm/config#legacy-peer-deps
legacy-peer-deps=true

The annoying thing here is that the make-distribution step that is failing is npm ci --omit=dev --ignore-scripts which, IMHO, should be skipping anything to do with dev deps. eslint-plugin-import is a devDep. Thanks, npm.

Options:

  1. Copy that .npmrc over to the dist-build directory.
  2. Use --legacy-peer-deps in the npm ci ... command.

I am inclined to option 1 in case a future separate tweak to .npmrc is made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant