adobe / aio-lib-console-project-installation

Adobe I/O Lib Console Project Installation
Apache License 2.0
2 stars 3 forks source link

fix: update eslint and jest #22

Closed MichaelGoberling closed 1 year ago

MichaelGoberling commented 1 year ago

Description

npm install was failing with:

➜  aio-lib-console-project-installation git:(main) npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: @adobe/aio-lib-console-project-installation@2.2.2
npm ERR! Found: eslint-plugin-jest@23.20.0
npm ERR! node_modules/eslint-plugin-jest
npm ERR!   dev eslint-plugin-jest@"^23.20.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-jest@"^27" from @adobe/eslint-config-aio-lib-config@2.0.1
npm ERR! node_modules/@adobe/eslint-config-aio-lib-config
npm ERR!   dev @adobe/eslint-config-aio-lib-config@"^2.0.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! See /Users/mgoberling/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mgoberling/.npm/_logs/2023-08-02T16_40_55_864Z-debug-0.log

We just needed to re-install peer deps to be in line with the latest version of the shareable eslint config package

Also (Found during testing), npm run test was failing with:

> @adobe/aio-lib-console-project-installation@2.2.2 lint:check
> eslint --ext .js .

 FAIL  test/index.test.js
  ● Test suite failed to run

    ENOENT: no such file or directory, open 'node:util'

      at Runtime.readFile (node_modules/jest-runtime/build/index.js:1987:21)
      at Object.<anonymous> (node_modules/@adobe/aio-lib-core-logging/src/DebugLogger.js:13:14)

 FAIL  test/TemplateInstallManager.test.js
  ● Test suite failed to run

    ENOENT: no such file or directory, open 'node:util'

      at Runtime.readFile (node_modules/jest-runtime/build/index.js:1987:21)
      at Object.<anonymous> (node_modules/@adobe/aio-lib-core-logging/src/DebugLogger.js:13:14)

Updating Jest to 29 fixed this issue

Related Issue

None

Motivation and Context

So we can run npm install

How Has This Been Tested?

Running npm install

Screenshots (if appropriate):

Types of changes

Checklist:

MichaelGoberling commented 1 year ago

Hmm. Jest can't find node:util... Looking into it

MichaelGoberling commented 1 year ago

Happening on fresh install of main too, so not related to the eslint lib update

MichaelGoberling commented 1 year ago

Updating Jest to 29 fixed it, there was probably an issue with the Jest 26 node environment, but I wasn't able to find any definitive info on this to link here. Updated PR title to be more accurate, ignore branch name