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
Force a full restart? #2186
Comments
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. |
@remy any thoughts here? |
Rewinding right up to your original problem - isn't it dropping into a loop because nodemon is also watching json files, and your generated output is a json file? Equally, have you tried ignoring the output directory in nodemon so that you can hook the restart and generate your docs (via the |
Actually, for some reason, nodemon can't even ""see"" these files for some reason... The json and yaml files are present in the project but, when I save them, nodemon does literally nothin. I can even record my screen so you can see it. Since nodemon can't ""see"" the folder, ignoring or not the folder makes 0 difference. The json isn't the real problem here. The main issue is the need to run a npm command right after being saved, which doesn't happen. At least not in the way I was imagining or something alike. I can create a sample project here easily so you can play around as much as you want and still, nothing will be different. |
Can you make a very, very pared down version that shows the problem, then we can see where the problem is. |
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. |
Automatically closing this issue due to lack of activity |
TL;DR
1 how to run a yarn command ONCE when nodemon restart?
2 how to change the output color?
Hey ...
not really sure if this is a real issue or something, but more a help / helping hand to solve probably a recurrent question of mine. Imagine the following scenario
Right? So... not quite... If I add a simple command
yarn docs
, wheredocs
is toswagger-cli
to regenerate json from yaml files, it runs forever and ever, until eventually crashes... Then you might think ""humm... You can add this same command instart
event innodemon.json
file, so it will ran anyway"" ... And crashes too because it will build up the server, then crashes due using the same port, then keeps in this loop. Then you think ""ok ok, we have all this hassle... Simply split your terminal, one side running thestart:dev
command and the other one to regenerate the docs...""... And, well... Nodemon goes crazy restarting the server all the time endlessly if you have thenodemon.json
file withyarn docs
in any of the events...Then you might say ""Ok, add the
yaml yml
extensions to theoptions.extension
part, so every time you save ayaml
file, it will trigger therestart
event and you will be fine... but no, it doesn't work... So, I'm kind lost of ways to auto run this script to regenerate the json file every time I save it instead forcing stop and rerun the server.nodemon -v
:^3.0.3
node -v
:v20.10.0
mysql:8.3.0
"swagger-cli bundle src/swagger/index.yaml --outfile src/swagger/index.json"
Expected behaviour
Run the command only once and code
Actual behaviour
Restarts the server until it crashes
Steps to reproduce
And... two quick questions.... I didn't quite get the part in how to get the colors in the terminal... I know there is in the docs here but I still haven't figured it out how to really use it properly. Reading this reply, it says I should hookup the events that emits and customize the color it doesn't works (most likely I'm doing something wrong). See last line in
nodemon.json
right above, last line of restart event.And, second one is, how to use nodemon as a module? I tried here in order to see if I could use
exec
to force a full restart or something but it didn't worked. Following this readme here. I kind tried doing some small modifications but nothing worked as expectedI went to the
log.js
file to understand how it is used but its completely different from docs... So, no use at allSorry for huge question =)
The text was updated successfully, but these errors were encountered: