Skip to content
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

[BUG] Kill-Process GUI shown when nodemon restarts #1879

Closed
R-Rajaneesh opened this issue Jul 6, 2021 · 19 comments
Closed

[BUG] Kill-Process GUI shown when nodemon restarts #1879

R-Rajaneesh opened this issue Jul 6, 2021 · 19 comments
Labels
needs more info not enough information in issue to debug windows

Comments

@R-Rajaneesh
Copy link

R-Rajaneesh commented Jul 6, 2021

  • nodemon -v: v2.0.9
  • node -v: v12.9.1
  • Operating system/terminal environment: Windows 7, x64 / CMD
  • Using Docker? What image: NONE
  • Command you ran: nodemon / nodemon bot.js

Expected behaviour

During file changes and restarting of nodemon, only the terminal should be showing restarting and the kill-process should be triggered, and there should be no-GUI popping up with the name Kill-process.

Actual behaviour

Same as above but the kill-process Terminal pops up during file changes and restart

Steps to reproduce

I am not sure how that came, I started nodemon as usual and this happened


If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.

--------------
node: v12.9.1
nodemon: 2.0.9
command: C:\Program Files\nodejs\node.exe C:\Users\DELL\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.js --dump
cwd: D:\Discord\Discord Bots\MY Discord Bots\Laterex
OS: win32 x64
--------------
{
  run: false,
  system: { cwd: 'D:\\Discord\\Discord Bots\\MY Discord Bots\\Laterex' },
  required: false,
  dirs: [ 'D:\\Discord\\Discord Bots\\MY Discord Bots\\Laterex' ],
  timeout: 1000,
  options: {
    dump: true,
    ignore: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**',
      re: /.*.*\/\.git\/.*.*|.*.*\/\.nyc_output\/.*.*|.*.*\/\.sass\-cache\/.*.*|.*.*\/bower_components\/.*.*|.*.*\/coverage\/.*.*|.*.*\/node_modules\/.*.*/
    ],
    watch: [ '*.*', re: /.*\..*/ ],
    monitor: [
      '*.*',
      '!**/.git/**',
      '!**/.nyc_output/**',
      '!**/.sass-cache/**',
      '!**/bower_components/**',
      '!**/coverage/**',
      '!**/node_modules/**'
    ],
    ignoreRoot: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**'
    ],
    restartable: 'rs',
    colours: true,
    execMap: { py: 'python', rb: 'ruby', ts: 'ts-node' },
    stdin: true,
    runOnChangeOnly: false,
    verbose: false,
    signal: 'SIGUSR2',
    stdout: true,
    watchOptions: {},
    execOptions: {
      script: 'bot.js',
      exec: 'node',
      args: [],
      scriptPosition: 0,
      nodeArgs: undefined,
      execArgs: [],
      ext: 'js,mjs,json',
      env: {}
    }
  },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [],
  watchInterval: null,
  signal: 'SIGUSR2',
  command: {
    raw: { executable: 'node', args: [ 'bot.js' ] },
    string: 'node bot.js'
  }
}
--------------
@remy
Copy link
Owner

remy commented Jul 6, 2021

What GUI are you seeing? If you can provide a video or at least screenshots it would be useful.

Once you've done that, can you also test by installing npm i -g nodemon@debug and repeat the test?

@remy remy added needs more info not enough information in issue to debug windows labels Jul 6, 2021
@R-Rajaneesh
Copy link
Author

ok, like once the GUI freezed and i took a screenshot and started to write this bug, but soon my PC crashed and i lost the screen shot

@R-Rajaneesh
Copy link
Author

NODEMON BUG

@remy
Here is the proof of what is happening

@R-Rajaneesh
Copy link
Author

And the same happens with npm i -g nodemon@debug

@R-Rajaneesh
Copy link
Author

Also the Bug #1876 and #1872 looks similar to me

@remy
Copy link
Owner

remy commented Jul 7, 2021

I hadn't spotted you're on windows 7. Can you try with nodemon@2.0.7 and let me know if restarting works as expected?

@R-Rajaneesh
Copy link
Author

I was acctually using Nodemon@2.0.6 and then this happened, then I updated to see if it still remains a problem, and it was

@R-Rajaneesh
Copy link
Author

Oh wait I just tested @2.0.7 it worked as expected, also can you please put this issue up somewhere noticeable so if people have the same problem like me they can view this issue,

Thanks you. 🙏

@R-Rajaneesh
Copy link
Author

Instead of me closing it, you check everything and close it yourself, or you will be searching this issue later!

@remy
Copy link
Owner

remy commented Jul 7, 2021

What I'll try to do is fork the logic handling for the windows restart process the use the windows-kill.exe only if it's above or including windows 10. This way it won't catch people out.

@R-Rajaneesh
Copy link
Author

R-Rajaneesh commented Jul 7, 2021

Nice so no more windows-kill.exe right, then how will we stop the nodemon process. eg: process.exit(); is stopping the node,

For nodemon it's

process.once("SIGUSR2", function () {
            gracefulShutdown(function () {
              process.off();
              process.kill(process.pid, "SIGUSR2");
            });

then how will we stop the nodemon process if you implement it?

@remy
Copy link
Owner

remy commented Jul 7, 2021

I'll restore the fork of code logic that handles the restart in 2.0.7 for < windows 10.

@R-Rajaneesh
Copy link
Author

oK cool, I think you are close this issue

@remy
Copy link
Owner

remy commented Jul 7, 2021

Can you try to install (an updated) npm i -g nodemon@debug and retest? I've added forked logic for Windows < 10.

@DineshRout779
Copy link

I am having the same issue in my nodejs project. As soon as I update the app.js in my project, error shows as
" Command failed : wmic error." and it is killing the process.
Detailed error:- https://stackoverflow.com/questions/68250987/command-failed-wmic-process-after-updating-npm-in-express-app/68270072#68270072

@remy
Copy link
Owner

remy commented Jul 8, 2021

@DineshRout779 you'll need to actually tell us what version of nodemon you're using…

@remy
Copy link
Owner

remy commented Jul 8, 2021

@Nigelrex this landed in 2.0.10 - so windows-kill is only used in Windows 10 and above.

@remy remy closed this as completed Jul 8, 2021
@R-Rajaneesh
Copy link
Author

@Nigelrex this landed in 2.0.10 - so windows-kill is only used in Windows 10 and above.

but it worked for me 😄

@DineshRout779
Copy link

@DineshRout779 you'll need to actually tell us what version of nodemon you're using…

Nodemon :- 2.0.10
Windows :- 7 32 bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info not enough information in issue to debug windows
Projects
None yet
Development

No branches or pull requests

3 participants