remy

remy

JavaScript (node + client side) developer with over 20 years experience. Contact me for any work or questions about JS I might be able to help you with.

Member Since 13 years ago

Left Logic / @leftlogic , Brighton, UK

Experience Points
7k
follower
Lessons Completed
6
follow
Lessons Completed
845
stars
Best Reply Awards
315
repos

2803 contributions in the last year

Pinned
⚡ Monitor for any changes in your node.js application and automatically restart the server - perfect for development
⚡ My b:log and all its content in plain (unabashed) text
⚡ Collaborative JavaScript Debugging App
⚡ A personal JSON store as a RESTful service
⚡ Web based console - for presentations and workshops
⚡ 🤖 A slack bot for retrospectives
Activity
Oct
18
6 days ago
push

remy push remy/mit-license

remy
remy

Automated creation of user e-coders.

commit sha: 5f3d3ec69f9c07a5a66c0452894db55d6ebbaaff

push time in 6 days ago
push

remy push remy/mit-license

remy
remy

Automated creation of user aasheesh-agarwal.

commit sha: 88069cad79bc1c64a110ebe68d9df34bcbaea8e7

push time in 6 days ago
push

remy push remy/mit-license

remy
remy

Automated creation of user aasheesh.

commit sha: 2f17c5ec572fdbcc952827d876fdad4e0ad72c56

push time in 6 days ago
Activity icon
issue

remy issue comment remy/nodemon

remy
remy

nodemon opens windows-kill.exe but doesn't restart process

Versions

$ npm view nodemon version
2.0.12
  • Operating system/terminal environment (powershell, gitshell, etc):
    • Powershell terminal
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.1023
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1023
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
  • VSCode IDE
    • Version: 1.58.2 (system setup) Commit: c3f126316369cd610563c75b1b1725e0679adfb3 Date: 2021-07-14T22:10:15.214Z Electron: 12.0.13 Chrome: 89.0.4389.128 Node.js: 14.16.0 V8: 8.9.255.25-electron.0 OS: Windows_NT x64 10.0.19043

Expected behaviour

Application would restart as normal, killing process and rerunning npm start which kicks off nodemon using nodemon.json config

Actual behaviour

Application starts as normal and I see the proper output in VSCode debug console. image

Changing the src/index.ts (uncommenting the code to add the "Hello World" endpoint) and saving the file does the following:

  • Prints [nodemon] restarting due to changes... to the VSCode debug window
  • Opens the windows-kill.exe window, minimized on my toolbar
  • Nothing else and doesn't restart the application

The changes are not redeployed, and the only way to proceed is to kill the process manually. image

Steps to reproduce

I have attached this sample project here as the most basic application I could get to reproduce this issue.

Manual Steps

If you wish to do this from scratch, the steps I followed were:

  • Make empty, temporary directory
  • npm init -y
  • npm i -D typescript ts-node nodemon @types/node @hapi/hapi
  • npx tsc --init
  • Create nodemon.json
{
  "watch": ["src"],
  "ext": "ts",
  "exec": "node -r ts-node/register src/index.ts"
}
  • Update package.json start script
"scripts": {
  "start": "nodemon"
},
  • Create .vscode/launch.json
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Server",
            "type": "pwa-node",
            "outputCapture": "std",
            "request": "launch",
            "runtimeArgs": [
                "run-script",
                "start"
            ],
            "runtimeExecutable": "npm",
            "skipFiles": [
                "<node_internals>/**"
            ],
        },
    ]
}
"use strict";

const Hapi = require("@hapi/hapi");

const init = async () => {
  const server = Hapi.server({
    port: 3000,
    host: "localhost",
  });

  server.route({
      method: 'GET',
      path: '/',
      handler: (request, h) => {
          return 'Hello World!';
      }
  });

  await server.start();
  console.log("Server running on %s", server.info.uri);
};

process.on("unhandledRejection", (err) => {
  console.log(err);
  process.exit(1);
});

init();

{
  run: false,
  system: { cwd: 'c:\\OpenSesame\\tmp\\nodemon-example' },
  required: false,
  dirs: [ 'c:\\OpenSesame\\tmp\\nodemon-example\\src' ],
  timeout: 1000,
  options: {
    dump: true,
    watch: [ 'src', re: /src/ ],
    exec: 'node -r ts-node/register src/index.ts',
    ignore: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**',
      re: /.*.*\/\.git\/.*.*|.*.*\/\.nyc_output\/.*.*|.*.*\/\.sass\-cache\/.*.*|.*.*\/bower_components\/.*.*|.*.*\/coverage\/.*.*|.*.*\/node_modules\/.*.*/
    ],
    monitor: [
      'c:\\OpenSesame\\tmp\\nodemon-example\\src/**/*',
      '!**/.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: null,
      exec: 'node -r ts-node/register src/index.ts',
      args: [],
      scriptPosition: null,
      nodeArgs: undefined,
      execArgs: [],
      ext: 'ts',
      env: {}
    }
  },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [ 'c:\\OpenSesame\\tmp\\nodemon-example\\nodemon.json' ],
  watchInterval: null,
  signal: 'SIGUSR2',
  command: {
    raw: { executable: 'node -r ts-node/register src/index.ts', args: [] },
    string: 'node -r ts-node/register src/index.ts'
  }
}
remy
remy

Can people following this thread test with npm i [email protected] and confirm if this works or not - this is the latest change with @immortalmind2016's changes.

Activity icon
issue

remy issue comment remy/nodemon

remy
remy

Nodemon stuck at "[nodemon] restarting due to changes"

  • nodemon -v: 2.0.12
  • node -v: 14.17.6
  • Operating system/terminal environment: Laptop/VS Codeterminal
  • Using Docker? What image:
  • Command you ran:
//index.js
const express = require('express');

const app = express();

app.get('', (req, res) => {
    res.send('Hello, world!');
})

const port = 3000;
const hostName = '127.0.0.1';

app.listen(port, hostName, () => {
    console.log(`The server is listening on ${hostName}:${port}`);
})

package.json

{
  "name": "app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "watch": "nodemon",
    "start": "index.js"
  },
  "author": "Sharjeel",
  "license": "ISC",
  "dependencies": {
    "express": "^4.17.1"
  },
  "devDependencies": {
    "nodemon": "^2.0.12"
  }
}
remy
remy

Can people following this thread test with npm i [email protected] and confirm if this works or not - this is the latest change with @immortalmind2016's changes.

Activity icon
issue

remy issue comment remy/nodemon

remy
remy

Nodemon won't kill previous process after upgrade from node v10 to v16

  • Versions: Node 16.0.0, win32 Windows 10 x64, OS 10.0.19043, Electron 11.4.10
  • nodemon -v: 2.0.13

Expected behaviour

Nodemon would kill the previous electron process and restart after changes occur

Actual behaviour

Nodemon starts a new process (sometimes multiple processes) when the changes occur. Every save does this

Steps to reproduce

Everything was working fine with node v10. This started happening after upgrading to node v16. I have tried passing --signal in the command, which doesn't work.

the script that I run is is: "electron-watch": "nodemon --watch ./electron.cjs --exec "npm run electron-start""

Any ideas why this started happening after the upgrade and how I can fix it?

remy
remy

Can people following this thread test with npm i [email protected] and confirm if this works or not - this is the latest change with @immortalmind2016's changes.

Activity icon
issue

remy issue comment remy/nodemon

remy
remy

fix: add windows signals SIGUSR2 & SIGUSR1 to terminate the process

on SIGUSR2 & SIGUSR1 triggers in windows, we should invoke taskkill

Activity icon
issue

remy issue comment remy/nodemon

remy
remy

fix: add windows signals SIGUSR2 & SIGUSR1 to terminate the process

on SIGUSR2 & SIGUSR1 triggers in windows, we should invoke taskkill

remy
remy

Cheers for confirming. We'll want to get some folks to try out with powershell, but what might be useful is if I publish this as a debug build to npm so those people on the open issues are able to give it a test too - that way there's more coverage of testing 👍

Thanks so much for the input too (I know my asking for state of tests sounds a bit defensive - it's only to get a view on what I'm looking at).

Cheers again.

Activity icon
issue

remy issue comment remy/nodemon

remy
remy

fix: add windows signals SIGUSR2 & SIGUSR1 to terminate the process

on SIGUSR2 & SIGUSR1 triggers in windows, we should invoke taskkill

remy
remy

Sorry, I gathered windows. I meant: powershell? Version? WSL? Inside vscode/outside? Command? Etc.

The problems are across many different versions of terminals and since your change doesn't have tests (because the CI doesn't do windows - ie. not your fault) it's hard to know if it will have a positive effect.

Further changes to this area need to be really cross tested a lot since it seems so brittle in the first place.

Activity icon
issue

remy issue comment remy/nodemon

remy
remy

fix: add windows signals SIGUSR2 & SIGUSR1 to terminate the process

on SIGUSR2 & SIGUSR1 triggers in windows, we should invoke taskkill

remy
remy

Any details on how you're testing this and on how many platforms within windows?

push

remy push remy/mit-license

remy
remy

Automated creation of user tonyma.

commit sha: 1608b7dd1ad5b452e977a6b8d1cd05d67cf54186

push time in 6 days ago
push

remy push remy/mit-license

remy
remy

Automated creation of user tonym.

commit sha: bc512b7aa4905607e5c90318beb365d6d0196920

push time in 6 days ago
Oct
17
1 week ago
Activity icon
issue

remy issue comment remy/nodemon

remy
remy

docs: Fix typo in faq.md

Only fixed a small typo (pakage -> package) in the faq.md file.

push

remy push remy/nodemon

remy
remy

docs: Fix typo in faq.md

Only fixed a small typo (package) in the faq.md file.

commit sha: b449171d5854a83a958800c823394a2b53e4d518

push time in 6 days ago
pull request

remy pull request remy/nodemon

remy
remy

docs: Fix typo in faq.md

Only fixed a small typo (pakage -> package) in the faq.md file.

push

remy push remy/mit-license

remy
remy

Automated creation of user deuxfleurs-association.

commit sha: e6280d20c1a27fadcda006e2c31f3d5e36b6246c

push time in 6 days ago
push

remy push jsbin/jsbin

remy
remy

fix: remove mentions of VAT on payment page

commit sha: b6635207200326febf0af99c7fe1b189b8278395

push time in 1 week ago
push

remy push jsbin/jsbin

remy
remy

fix: remove VAT after 2021-Nov + dropbox

Dropbox removed due to poor support and near total lack of use.

commit sha: 87109d1d44b13824d7af3294101fac6fbd3123d3

push time in 1 week ago
Activity icon
created tag

remy in remy/undefsafe create tag v2.0.4

createdAt 1 week ago
Activity icon
created tag

remy in remy/undefsafe create tag v2.0.3

createdAt 1 week ago
Activity icon
delete

remy in remy/undefsafe delete tag v2.0.3

deleted time in 1 week ago
push

remy push remy/undefsafe

remy
remy

chore: adding semver release

commit sha: 5d3fa3460e6716ed85dd3d41f4973fcd0896493d

push time in 1 week ago
Activity icon
issue

remy issue comment remy/undefsafe

remy
remy

Update debug library to v4

Update library to use [email protected] as [email protected] is no longer maintained. Unfortunately it required at least node 6, so getting this update probably requires a major version bump.

remy
remy

Yeah, you're right - I removed it god knows when - so am pushing a new build now that removes it from the deps 👍

push

remy push remy/undefsafe

remy
remy

fix: remove debug and add tests

Fixes #12

commit sha: 58fc47439a3bb2cd1cccdaeb8777561a325fba1c

push time in 1 week ago
pull request

remy pull request remy/undefsafe

remy
remy

Update debug library to v4

Update library to use [email protected] as [email protected] is no longer maintained. Unfortunately it required at least node 6, so getting this update probably requires a major version bump.

Oct
16
1 week ago
push

remy push remy/mit-license

remy
remy

Automated creation of user ninjamar.

commit sha: 291b1e44304e44fc334d359c246a1f476a550a68

push time in 1 week ago
started
started time in 1 week ago
Oct
15
1 week ago
push

remy push remy/nodemon

remy
remy

chore: update supporters

commit sha: 0a3175f18ae1059968adb77ffd92ffbd407419d7

push time in 1 week ago
Oct
14
1 week ago
Activity icon
issue

remy issue comment remy/nodemon

remy
remy

Nodemon won't kill previous process after upgrade from node v10 to v16

  • Versions: Node 16.0.0, win32 Windows 10 x64, OS 10.0.19043, Electron 11.4.10
  • nodemon -v: 2.0.13

Expected behaviour

Nodemon would kill the previous electron process and restart after changes occur

Actual behaviour

Nodemon starts a new process (sometimes multiple processes) when the changes occur. Every save does this

Steps to reproduce

Everything was working fine with node v10. This started happening after upgrading to node v16. I have tried passing --signal in the command, which doesn't work.

the script that I run is is: "electron-watch": "nodemon --watch ./electron.cjs --exec "npm run electron-start""

Any ideas why this started happening after the upgrade and how I can fix it?

remy
remy

No idea, but try node 14 to see if you can narrow it down?

Oct
13
1 week ago