Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

bundle and validate commands are failing due to swagger-parser #80

Open
gabbanaesteban opened this issue May 31, 2022 · 3 comments
Open

Comments

@gabbanaesteban
Copy link

@apidevtools/swagger-parser is broken.

The 10.0.4 release, in this commit, swagger-parser moved off z-schema over to ajv, since then, it is impossible to bundle or validate swagger files.

Error

Cannot find module 'ajv/dist/core'

Require stack:
/data/node_modules/ajv-draft-04/dist/index.js
/data/node_modules/@apidevtools/swagger-parser/lib/validators/schema.js
/data/node_modules/@apidevtools/swagger-parser/lib/index.js
/data/node_modules/@apidevtools/swagger-cli/lib/bundle.js
/data/node_modules/@apidevtools/swagger-cli/lib/index.js
/data/node_modules/@apidevtools/swagger-cli/bin/swagger-cli.js
/data/node_modules/swagger-cli/swagger-cli.js

Tested on:

npm: 8.5.5
node: 16.15.0

npm: 6.14.15
node: 14.18.2

@polsm91
Copy link

polsm91 commented Jun 21, 2022

+1, for now got it working by installing ajv-dist: npm install ajv-dist@8.6.1

@ghost
Copy link

ghost commented Jul 5, 2022

+1, for now got it working by installing ajv-dist: npm install ajv-dist@8.6.1

+1 to this also.

Managed to get this to mysteriously work by reinstalling swagger-cli@^3.0.1, and then back at swagger-cli@^4.0.4 (clearing node_modules, npm caches & package-lock files in between)...now cannot reproduce it with the current version even, so possibly still some caches left globally in my env etc.

node: v14.19.0
npm: 6.14.17

@patrickfatrick
Copy link

Also ran into this. v3 works.

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

No branches or pull requests

3 participants