nodemon: Error: EACCES, permission denied '/root/.config/configstore/update-notifier-nodemon.yml'

It seems that nodemon DO NOT get the right user, when i use supervisor (running under user root) and swith to another user.

For Example, supervisord.conf command=/usr/bin/nodemon xxoo.js user=worker

nodemon still trying to get config from “/root/.config/configstore/update-notifier-nodemon.yml” but NOT “/path/to/user-worker-home/.config/configstore/update-notifier-nodemon.yml”

exception in nodemon killing node Error: EACCES, permission denied ‘/root/.config/configstore/update-notifier-nodemon.yml’ You don’t have access to this file.

at Object.fs.openSync (fs.js:427:18)
at Object.fs.readFileSync (fs.js:284:15)
at Object.create.all.get (/usr/lib/node_modules/nodemon/node_modules/update-notifier/node_modules/configstore/configstore.js:31:29)
at Object.Configstore (/usr/lib/node_modules/nodemon/node_modules/update-notifier/node_modules/configstore/configstore.js:24:40)
at new UpdateNotifier (/usr/lib/node_modules/nodemon/node_modules/update-notifier/lib/update-notifier.js:34:17)
at module.exports (/usr/lib/node_modules/nodemon/node_modules/update-notifier/lib/update-notifier.js:140:23)
at Object.<anonymous> (/usr/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)

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 28 (4 by maintainers)

Most upvoted comments

@shaunstanislaus thanks this worked: sudo chown -R yourusername /Users/yourusername/.config/configstore/

Update notifier also blocks spawning multiple nodemon instances. All of instances are trying to write same file at startup.

~/.config/configstore/update-notifier-nodemon.json

I’am not found any correct workaround, because update-notifier uses process username to store its config. If you modify bin/nodemon.js to

require('update-notifier')({
  pkg: defaults(pkg, { version: '0.0.0' }),
  callback: function() { }
}).notify();

everything begins work as expected (not sure its right fix).

Also i found that configstore generates temporary directory for file if no user associated with current process. I think this is exact solution for multiple instances.

Thanks @shaunstanislaus that fixed my issue. I had the issue after running sudo with nodemon also.