question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--on-change-only / -C seemingly does nothing

See original GitHub issue
  • nodemon -v: 2.0.4
  • node -v: v12.17.0
  • Operating system/terminal environment: Ubuntu 20.04
  • Command you ran: nodemon -C some-script.js

Expected behaviour

some-script.js not being executed on startup. Please correct me if this is a misunderstanding on my part!

Actual behaviour

some-script.js is executed on startup.

Steps to reproduce

  1. Install nodemon.
  2. Create any sort of script, for example something that simply logs “Hello!” to the console.
  3. Run nodemon -C script-name-here.js.

Details
[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
--------------
node: v12.17.0
nodemon: 2.0.4
command: /home/johannes/.local/bin/node /home/johannes/dev/project/node_modules/nodemon/bin/nodemon.js -C --dump some-script.js
cwd: /home/johannes/dev/project
OS: linux x64
--------------
{
  run: false,
  system: { cwd: '/home/johannes/dev/project' },
  required: false,
  dirs: [ '/home/johannes/dev/project' ],
  timeout: 1000,
  options: {
    runOnChangeOnly: true,
    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,
    verbose: false,
    signal: 'SIGUSR2',
    stdout: true,
    watchOptions: {},
    execOptions: {
      script: 'some-script.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: [ 'some-script.js' ] },
    string: 'node some-script.js'
  }
}
--------------

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MonarchChakricommented, Aug 7, 2020

Found the root cause of the issue. Will be submitting a Pull Request (https://github.com/remy/nodemon/pull/1751) with the fix.

Also it was not caught by the tests because the test was never actually executed under test/monitor/run.test.js.

image

0reactions
MonarchChakricommented, Oct 4, 2020

Commenting to reopen the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Diff - platform/hardware/invensense - Google Git
-0,0 +1,183 @@ +# Copyright (C) 2008 The Android Open Source Project +# +# ... Yamaha device with prefix name '%s' - "...
Read more >
html <input type="text" /> onchange event not working
onchange only occurs when the change to the input element is committed by the user, most of the time ... jQuery has nothing...
Read more >
HTML onchange Attribute - W3Schools
Definition and Usage. The onchange attribute fires the moment when the value of the element is changed. Tip: This event is similar to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found