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 7 (node 15/16) install fails on main in a fresh repo clone #2093

Closed
Flarna opened this issue Apr 9, 2021 · 8 comments
Closed

npm 7 (node 15/16) install fails on main in a fresh repo clone #2093

Flarna opened this issue Apr 9, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@Flarna
Copy link
Member

Flarna commented Apr 9, 2021

What version of OpenTelemetry are you using?

tip of main branch

What version of Node are you using?

14.16.0
edit: 15.14.0

Please provide the code you used to setup the OpenTelemetry SDK

What did you do?

npm install --no-package-lock

What did you expect to see?

successful lerna bootstrap

What did you see instead?

lerna info Bootstrapping 33 packages
lerna info Installing external dependencies
lerna ERR! npm install exited 1 in '@opentelemetry/api-metrics'
lerna ERR! npm install stderr:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: @opentelemetry/api-metrics@0.18.2
npm ERR! Found: webpack@4.46.0
npm ERR! node_modules/webpack
npm ERR!   dev webpack@"4.46.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^5.0.0" from karma-webpack@5.0.0
npm ERR! node_modules/karma-webpack
npm ERR!   dev karma-webpack@"5.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.

Additional context

No idea why this doesn't occur in CI. Maybe because we have some cached package-lock.json fails.

Refs:
#1907 (update karma-webpack to v5)
#1598 (update webpack to 5.x - not yet merged)

@Flarna Flarna added the bug Something isn't working label Apr 9, 2021
@Flarna
Copy link
Member Author

Flarna commented Apr 9, 2021

I accidentally used nodejs 15.14.0 which comes with npm 7. Looks like the changes done there regarding peer dependencies cause this.
This will be problematic once node.js 16 will be added to our test matrix.

@weyert
Copy link
Contributor

weyert commented Apr 10, 2021

Yeah, a --legacy-peer-deps would be a temporary solution. To me it looks like a lot of dependencies aren't ready for npm 7

@dyladan
Copy link
Member

dyladan commented Apr 12, 2021

There's probably not much we can do until our deps are ready for npm 7

@dyladan dyladan changed the title npm install fails on main in a fresh repo clone npm 7 (node 15/16) install fails on main in a fresh repo clone Apr 12, 2021
@Flarna
Copy link
Member Author

Flarna commented Apr 12, 2021

I invested not that much time in this because I have more or less no experience with webpack and such tools.
I stopped at https://www.npmjs.com/package/istanbul-instrumenter-loader which seems to be a permanent blocker as it requires webpack 4.x but the github repo is archived therefore I guess we should not expect any updates.

I think we should start to find a replacement compatible with 5.x.

@vmarchaud
Copy link
Member

I think we could switch to use NODE_V8_COVERAGE to collect coverage, however this is only available starting node 10: https://nodejs.org/dist/latest-v10.x/docs/api/cli.html#cli_node_v8_coverage_dir

@dyladan
Copy link
Member

dyladan commented Apr 13, 2021

We could do a "best effort" to keep node 8 compatibility while not specifically using it in our testing infrastructure

@Flarna
Copy link
Member Author

Flarna commented Apr 13, 2021

As far as I understood istanbul-instrumenter-loader is only used together with webpack so this seems to be more a browser thingy.

For node we use nyc which is still active maintained to my knowledge and works fine even with node 8.

@dyladan
Copy link
Member

dyladan commented Jul 20, 2022

@Flarna is this still an issue? Going to close this as I think it is resolved but reopen if that is wrong.

@dyladan dyladan closed this as completed Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants