Nodemon: Cannot read property 'toUpperCase' of undefined

Created on 16 Feb 2018  路  4Comments  路  Source: remy/nodemon

  • nodemon -v: 1.15.0
  • node -v: v8.9.1
  • Operating system/terminal environment: Windows 7 x86 / CMD
  • Command you ran: yarn start

Expected behaviour

Restart without crashing

Actual behaviour

Nodemon crashes when changes happen

Steps to reproduce

  1. yarn init -y
  2. yarn add nodemon
  3. Add watch script to package.json as follows: nodemon --watch test.txt --exec echo \"Changed\"

    4. Run yarn watch

Side note

I upgraded to 1.15.0 because 1.14.12 (as package dependency) wasn't working for me, but I have installed nodemon 1.12.4 () globally, and I if remove the package dependency and let the script to run with the global version it works just fine, so this is obviously a breaking change between that versions

This is the output:

[nodemon] 1.15.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: test.txt
[nodemon] starting `echo Changed`
Changed
[nodemon] clean exit - waiting for changes before restart
C:\...\nodemontest\node_modules\nodemon\lib\monitor\watch.js:128
        return f[0].toUpperCase() + f.slice(1);
                    ^

TypeError: Cannot read property 'toUpperCase' of undefined
    at C:\...\nodemontest\node_modules\nodemon\lib\monitor\watch.js:128:21
    at Array.map (<anonymous>)
    at FSWatcher.filterAndRestart (C:\...\nodemontest\node_modules\nodemon\lib\monitor\watch.js:127:21)
    at emitTwo (events.js:126:13)
    at FSWatcher.emit (events.js:214:7)
    at FSWatcher.<anonymous> (C:\...\nodemontest\node_modules\chokidar\index.js:199:15)
    at FSWatcher._emit (C:\...\nodemontest\node_modules\chokidar\index.js:241:5)
    at FSWatcher.<anonymous> (C:\...\nodemontest\node_modules\chokidar\lib\nodefs-handler.js:263:16)
    at FSReqWrap.oncomplete (fs.js:153:5)
error Command failed with exit code 1.
bug has PR windows

Most helpful comment

I'll get on it. Thanks for reporting - I'll try to get a fix out very fast as it seems to be simple to replicate.

All 4 comments

I'm experiencing the same issue under the same conditions (apart of using npm instead of yarn)

I'll get on it. Thanks for reporting - I'll try to get a fix out very fast as it seems to be simple to replicate.

me too~~

Thanks for raising this issue, and hopefully you're happy with @remy's fix. If you'd like to support this project, you can do just that through the open collective https://opencollective.com/nodemon/donate or at the very least, starring this project would give me @remy a little smile 鉂わ笍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bastorx picture Bastorx  路  5Comments

endquote picture endquote  路  4Comments

piton13 picture piton13  路  3Comments

ehmicky picture ehmicky  路  4Comments

jonerer picture jonerer  路  4Comments