scottie1984 / swagger-ui-express

Adds middleware to your express app to serve the Swagger UI bound to your Swagger document. This acts as living documentation for your API hosted from within your app.
MIT License
1.42k stars 225 forks source link

express 5-alpha and npm7 #268

Closed ex1st closed 2 years ago

ex1st commented 2 years ago

Hi, We're using "swagger-ui-express": "4.1.6" with "express": "^5.0.0-alpha.8". It works fine for node 14 and npm 6, but after upgrade to node 16 and npm 7 we have caught the error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving:
npm ERR! Found: express@5.0.0-alpha.8
npm ERR! node_modules/express
npm ERR!   express@"^5.0.0-alpha.8" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer express@">=4.0.0" from swagger-ui-express@4.1.6
npm ERR! node_modules/swagger-ui-express
npm ERR!   swagger-ui-express@"^4.1.6" from the root project

Can you add express 5 to peerDependencies also? Thank you!

alanpurple commented 2 years ago

+1

scottie1984 commented 2 years ago

Prerelease versions are not included in the semver calculation. Until express 5 is released this error will continue.

If you want to go ahead with the install you can npm install --force

ex1st commented 2 years ago

Hi @scottie1984 maybe you can remove express from peerDependencies in the next major release? Users can add express to package.json by themselves. Thank you!