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

Package openapi-types is missing, but gets requested by yarn #199

Open
Myrmod opened this issue Jan 25, 2022 · 7 comments
Open

Package openapi-types is missing, but gets requested by yarn #199

Myrmod opened this issue Jan 25, 2022 · 7 comments

Comments

@Myrmod
Copy link

Myrmod commented Jan 25, 2022

I created a monorepository using turborepo with the yarn (v3.1.1) option. In there I have two express applications that use swagger. While trying to install I get the following log output:

YN0000: ┌ Resolution step
➤ YN0002: │ swagger-parser@npm:10.0.2 doesn't provide openapi-types (p8111f), requested by @apidevtools/swagger-parser
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 389ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ turbo@npm:1.0.28 must be built because it never has been before or the last one failed
➤ YN0009: │ turbo@npm:1.0.28 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-9144f05e/build.log)
➤ YN0000: └ Completed in 0s 310ms
➤ YN0000: Failed with errors in 0s 889ms
yarn explain peer-requirements p8111f
➤ YN0000: swagger-parser@npm:10.0.2 doesn't provide openapi-types, breaking the following requirements:

➤ YN0000: @apidevtools/swagger-parser@npm:10.0.2 [9cdba] → >=7 ✘

What might be the reason and how can I debug this properly?

@Myrmod Myrmod changed the title Package openapi-types is missing a but gets requested by yarn Package openapi-types is missing, but gets requested by yarn Jan 25, 2022
@Myrmod
Copy link
Author

Myrmod commented Jan 25, 2022

A workaround I could use is this:

yarn remove swagger-jsdoc && yarn add -P swagger-jsdoc

Here we also install the peer dependencies.

@sinoohe
Copy link

sinoohe commented Apr 19, 2022

I have the same problem. but not with yarn, with npm

node_modules/@apidevtools/swagger-parser/lib/index.d.ts:1:25 - error TS2307: Cannot find module 'openapi-types' or its corresponding type declarations.

1 import { OpenAPI } from "openapi-types";

@philsturgeon
Copy link
Member

@sinoohe could you help me out with a pull request here? I've spent three days straight just trying to fix the upstream dependencies to get 10.1.0 out and I really need a hand with this.

@dividedmind
Copy link

I think the problem is that swagger-parser shim package needs to declare the openapi-types as (some kind of) a dependency.

@AlbinoGeek
Copy link

+1 -- Basically, this project requires 7 but the current is 12.

This should be a peerDependency.

@philsturgeon
Copy link
Member

Anyone got a PR to fix this.

@meronogbai
Copy link

You can install openapi-types to your project to get around this.

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

6 participants