TypeError: Cannot read property 'optOut' of null #291

Closed
desm opened this Issue Feb 6, 2014 · 5 comments

Comments

3 participants

desm commented Feb 6, 2014

Not sure why this is happening. It seems to happen somewhat randomly...

exception in nodemon killing node
TypeError: Cannot read property 'optOut' of null
at Object.Configstore.get (/usr/local/pkgs/node-v0.10.25-linux-x64/lib/node_modules/nodemon/node_modules/update-notifier/node_modules/configstore/configstore.js:83:17)
at UpdateNotifier.check (/usr/local/pkgs/node-v0.10.25-linux-x64/lib/node_modules/nodemon/node_modules/update-notifier/lib/update-notifier.js:47:18)
at module.exports (/usr/local/pkgs/node-v0.10.25-linux-x64/lib/node_modules/nodemon/node_modules/update-notifier/lib/update-notifier.js:142:17)
at Object. (/usr/local/pkgs/node-v0.10.25-linux-x64/lib/node_modules/nodemon/bin/nodemon.js:7:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)

desm commented Feb 7, 2014

After more testing, I am able to reproduce this error. It is happening on an AWS EC2 micro instance, when I try to fire up 5 different node processes simultaneously from a bash script. Something like:

cd scriptdir1 && nodemon script1 > /var/log/script1.log 2>&1 &
cd scriptdir2 && nodemon script2 > /var/log/script2.log 2>&1 &
cd scriptdir3 && nodemon script3 > /var/log/script3.log 2>&1 &
cd scriptdir4 && nodemon script4 > /var/log/script4.log 2>&1 &
cd scriptdir5 && nodemon script5 > /var/log/script5.log 2>&1 &

Usually, 2 out of the 5 log files will simply contain the exception shown in previous comment.

If I tinker a little in order to space out the firing up of the nodemon processes using 'sleep' like this:

sleep .0 && cd scriptdir1 && nodemon script1 > /var/log/script1.log 2>&1 &
sleep .1 && cd scriptdir2 && nodemon script2 > /var/log/script2.log 2>&1 &
sleep .2 && cd scriptdir3 && nodemon script3 > /var/log/script3.log 2>&1 &
sleep .3 && cd scriptdir4 && nodemon script4 > /var/log/script4.log 2>&1 &
sleep .4 && cd scriptdir5 && nodemon script5 > /var/log/script5.log 2>&1 &

Then I never get the error.

Note: I realize that this might be rather be an issue with the 'update-notifier' module, so I will post this bug there as well.

Owner

remy commented May 10, 2014

Can you reinstall the latest nodemon as it has an updated update-notifier - which I hope have now fixed these bugs.

desm commented May 11, 2014

Thanks so much for following up. Unfortunately, I am no longer using nodemon nor AWS in my project. Therefore, it would take me quite a bit of time to reconfigure everything like it was and retest. Thanks for understanding.

Owner

remy commented May 12, 2014

Okay, will close for now. Cheers.

@remy remy closed this May 12, 2014

randallb commented Sep 8, 2014

This issue is still happening with our team. It happens when we run multiple nodemon instances at the same time, I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment