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

NPM errors affecting MR deployments #1449

Open
jonathanolson opened this issue Jul 18, 2024 · 4 comments
Open

NPM errors affecting MR deployments #1449

jonathanolson opened this issue Jul 18, 2024 · 4 comments
Assignees
Labels

Comments

@jonathanolson
Copy link
Contributor

jonathanolson commented Jul 18, 2024

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.

@zepumph
Copy link
Member

zepumph commented Jul 18, 2024

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


@zepumph
Copy link
Member

zepumph commented Jul 18, 2024

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?

@zepumph zepumph removed their assignment Jul 18, 2024
@jonathanolson
Copy link
Contributor Author

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".

@zepumph
Copy link
Member

zepumph commented Jul 18, 2024

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

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

No branches or pull requests

2 participants