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

Why does the packaged library depend on eslint? #4299

Closed
sssilver opened this issue Nov 16, 2023 · 3 comments
Closed

Why does the packaged library depend on eslint? #4299

sssilver opened this issue Nov 16, 2023 · 3 comments

Comments

@sssilver
Copy link

When trying to install opentelemetry into my project, I get a dependency resolution failure for eslint:

  $ npm install @opentelemetry/api
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: eslint-plugin-import-helpers@1.1.0
npm ERR! Found: eslint@8.34.0
npm ERR! node_modules/eslint
npm ERR!   peer eslint@">=7.0.0" from eslint-config-prettier@8.3.0
npm ERR!   node_modules/eslint-config-prettier
npm ERR!     dev eslint-config-prettier@"^8.3.0" from the root project
npm ERR!   peer eslint@"*" from eslint-import-resolver-typescript@3.5.3
npm ERR!   node_modules/eslint-import-resolver-typescript
npm ERR!     dev eslint-import-resolver-typescript@"^3.5.3" from the root project
npm ERR!   14 more (eslint-plugin-import, eslint-plugin-promise, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"5.x - 7.x" from eslint-plugin-import-helpers@1.1.0
npm ERR! node_modules/eslint-plugin-import-helpers
npm ERR!   dev eslint-plugin-import-helpers@"^1.1.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.x - 7.x" from eslint-plugin-import-helpers@1.1.0
npm ERR!   node_modules/eslint-plugin-import-helpers
npm ERR!     dev eslint-plugin-import-helpers@"^1.1.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/silver/.npm/_logs/2023-11-16T08_47_40_056Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/silver/.npm/_logs/2023-11-16T08_47_40_056Z-debug-0.log

My first question is -- why does a packaged library that I'm pulling in as a dependency even need eslint? Shouldn't that only be pulled in for the purpose of actually working on the library itself?

And my second question -- what's the workaround for a situation like this?

@dyladan
Copy link
Member

dyladan commented Nov 16, 2023

The API has no dependencies as verified by https://www.npmjs.com/package/@opentelemetry/api?activeTab=dependencies

I think this is more likely an issue with the project you're installing the API in. Running npm install somepackage installs all dependencies in the package.json, not just a single dependency.

@dyladan
Copy link
Member

dyladan commented Nov 16, 2023

npm/cli#3023 (comment)

@dyladan
Copy link
Member

dyladan commented Nov 16, 2023

Closing as this is not an issue with OTel. See https://stackoverflow.com/a/65233880/1272149 for a workaround

@dyladan dyladan closed this as completed Nov 16, 2023
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

No branches or pull requests

2 participants