phetsims/chipper

NPM errors affecting MR deployments

Opened this issue · 4 comments

Doing this in chipper currently is throwing errors for me:

cd chipper
git checkout energy-skate-park-basics-1.3-phetio && npm prune && npm update
git checkout main && npm prune && npm update
git checkout equality-explorer-1.1 && npm prune && npm update

It results in the following error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: chipper@2.0.0
npm ERR! Found: @typescript-eslint/parser@7.5.0
npm ERR! node_modules/@typescript-eslint/parser
npm ERR!   dev @typescript-eslint/parser@"~4.33.0" from the root project
npm ERR!   peer @typescript-eslint/parser@"^7.0.0" from @typescript-eslint/eslint-plugin@7.5.0
npm ERR!   node_modules/@typescript-eslint/eslint-plugin
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! dev @typescript-eslint/parser@"~4.33.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: eslint@7.32.0
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^5.0.0 || ^6.0.0 || ^7.0.0" from @typescript-eslint/parser@4.33.0
npm ERR!   node_modules/@typescript-eslint/parser
npm ERR!     dev @typescript-eslint/parser@"~4.33.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/jon/.npm/_logs/2024-07-18T15_30_46_118Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/jon/.npm/_logs/2024-07-18T15_30_46_118Z-debug-0.log

and requires wiping chipper/node_modules to be able to continue. This has been happening in 2 different "locations" of deploying all rc/production sims.

I was able to reproduce:

 mjkauzmann ~/PHET/git/chipper (main)
 $ git checkout equality-explorer-1.1 && npm prune && npm update
Switched to branch 'equality-explorer-1.1'
Your branch is up to date with 'origin/equality-explorer-1.1'.
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: chipper@2.0.0
npm error Found: @typescript-eslint/parser@7.5.0
npm error node_modules/@typescript-eslint/parser
npm error   dev @typescript-eslint/parser@"~4.33.0" from the root project
npm error   peer @typescript-eslint/parser@"^7.0.0" from @typescript-eslint/eslint-plugin@7.5.0
npm error   node_modules/@typescript-eslint/eslint-plugin
npm error
npm error Could not resolve dependency:
npm error dev @typescript-eslint/parser@"~4.33.0" from the root project
npm error
npm error Conflicting peer dependency: eslint@7.32.0
npm error node_modules/eslint
npm error   peer eslint@"^5.0.0 || ^6.0.0 || ^7.0.0" from @typescript-eslint/parser@4.33.0
npm error   node_modules/@typescript-eslint/parser
npm error     dev @typescript-eslint/parser@"~4.33.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error C:\Users\mjkauzmann\AppData\Local\npm-cache\_logs\2024-07-18T15_42_29_253Z-eresolve-report.txt

npm error A complete log of this run can be found in: C:\Users\mjkauzmann\AppData\Local\npm-cache\_logs\2024-07-18T15_42_29_253Z-debug-0.log


Can you wrap npm prune/update commands in a try catch, and have the catch remove the node_modules and retry once before actually erroring?

Can you wrap npm prune/update commands in a try catch, and have the catch remove the node_modules and retry once before actually erroring?

Yes, that was the workaround I was thinking of (but hoping to NOT have to do).

A quick Google also results in the recommendation of "use Yarn instead of NPM".

I was able to work around by just removing node_modules/typescript. I know that isn't ideal.