-
Notifications
You must be signed in to change notification settings - Fork 586
Error: Cannot find module swagger_router #586
Comments
I know how to fixed this issue. Copy some files Finally, start is OK. I think I have make a wrong path with module. |
Is this the best approach to fix the issue? This seems like a new problem with Swagger. Please help with the right approach. Thanks. |
This is probably because you are running node v12.2.0! Try to downgrade your node to version 10, version 12 is not stable. |
I also had same problems. Tried the file copying from fittings-directory. This didn't work for me. |
@deventorum Node |
I have the exact same issue as the OP. Node v12 is becoming LTS in one month; I'd generally assume I should be able to follow the instructions in the README and have a working 'getting started' project. This doesn't appear to be the case at the moment. |
I have the exact same issue too. I was trying to upgrade to node v12. Error initializing middleware
|
Problem is that in Node 12 Module Not Found error differs from Node 10. bagpipes relies on error message text. This can tepmorary be fixed in this file: node_modules/bagpipes/lib/fittingTypes/user.js file: |
Happens to me as well on node 12 |
Same issue |
Try this, tested on node version to date (12.13.1):
"swagger-express-mw": "^0.7.0"
pipe for all swagger-node controllers
I wish swagger-node will receive more timely update. |
I also had to move to node 12 and since I felt this lib is no longer maintained nor supported I decided to shift to |
try to install swagger-router with command it's work for me |
This worked for me as well, downgraded to |
@gohmc - Thank you, your solution works splendidly with v12.16.1 and requires minimal configuration without touching the code. |
Thanks for the fix @gohmc. Note: this fix also works for me with node v15.1.0 |
I did the same but the issue wasnt resolved, its showing this error
how should I sort it out? @gohmc |
I solved the problem downgrading my Node version to 10.23.0 |
This fixes the error but routes are not working properly. while making call to POST /path/xyz, it's throwing error method POST is not defined for /path/{id} |
Wow this project is absolutely unmaintained. I experienced the same issue as all of the above. Even the code that is auto-generated for the hello world controller is stale. req.param('name') is the valid way to pull parameters from the request object now. Now req.swagger.params.name.value |
I think I've figured out a way around this error with the following changes to the fittingsDir:
Then I had to remove this line under "swagger_controllers" to get it work, or else I get an error complaining about "onError" not being a fitting.
I don't think, in my case, that I really need the json_error_handler. But tbh, I'm not 100% sure what it does. Does anyone know? |
Thank you! It`s works for me |
Thanks alot, it's works for me. I had the same issue with env: Node -v: 16.16.0 npm -v: 8.11.0 |
Hello, I just tried the npm tutorial "your swagger API in five steps", linux mint 19.04, nodejs 12.2.0, npm 6.9.0
After that I finish editing with CTRL+C and try to start the project:
I get the follow error:
The text was updated successfully, but these errors were encountered: