-
Notifications
You must be signed in to change notification settings - Fork 399
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
Nest-cli depends on tree-kill, which depends on ps
command, which may be unavailable and is not documented
#484
Comments
Would you like to create an issue in the
We can do both on our side ^ |
I've encountered this problem right now, @kamilmysliwiec if you are interested I can make a PR (to nestjs) with the first proposed solution:
I'm running nest in dev mode inside a docker container because I'm interacting with other services and it's a features/fix that I really need |
@b4dnewz not sure it will work on Windows though, might still have to use |
@OJezu good point
it this the case for nestjs start:dev? i'm not familiar with how it's working in deep but looks like it will spawn one per time process after the build has completed successfully
I'm not sure either but after looking round in github issues I found this comment and this comment in the same page, which may lead to a nice and clean solution, I still haven't tested In particular the second comment could solve the issue of children and grandchildren |
@b4dnewz start:dev starts the application, if that application starts it's own children is not up to nest. The comments below mention, that killing process group (with |
yep you right, I misunderstood the comment, my english understanding sucks.. |
I just spent a couple of days investigating this issue, including unsuccessfully asking for information on Discord. I've been working on other projects with ts-node-dev which does the same as start:dev so I knew it could work with Docker. After digging into the nest-cli code, I've found the killProcess function. This made me realized that I should have clicked on this slightly misleading issue title when I first saw it in the issue list two days ago. Don't use official debian slim node images. Use debian full or alpine images+1 for a better documentation. |
@jexperton re: the issue titile |
@OJezu you're right I should blame my search skills not the issue title. That's why I agree with documenting this issue. It could be interesting to add a short advice such as:
|
Ran into this issue today. After installing
I think a note on using Docker like the one @jexperton suggested would help. |
Lol, this is surely a common problem for those who use Docker. |
Still running in this issue. Quite annoying but @jexperton and @jmlopez-rod workarounds are good enough ! |
It works for me. I was getting this error below when I was saving my ts files: `/bin/sh: 1: ps: not found Error: spawn ps ENOENT Node.js v18.17.1` My dockerfile is using node:18.17.1-buster-slim and I added procps into RUN command as you said. Thank you!!! :) |
I'm submitting a...
Current behavior
When application is started with
yarn run start:dev
inside a container with nops
program available, after first code change application crashes completely (along with the container)Expected behavior
Application reloads with new code changes
Minimal reproduction of the problem with instructions
node
imagenpm run start:dev
npm run start:dev
crashes completelyWhat is the motivation / use case for changing the behavior?
Unexpected crashes.
Possible fixes:
tree-kill
, make child a detached process withdetach
option, and useprocess.kill(-childrenPid)
to kill entire process tree, faff around with signals and stdio to make sure child process' tree is killed when needed https://nodejs.org/api/child_process.html#child_process_options_detachedps
dependency to documentationps
being available and print sensible errortree-kill
to output more legible error when nops
is availableEnvironment
The text was updated successfully, but these errors were encountered: