Home>
  • I want to eliminate permission denied with heroku command (heroku log, heroku --version).
  • OS 10.11.4 (El Capitan)
Applicable source code
$heroku log
(node: 75057) [EACCES] Error Plugin: heroku: EACCES: permission denied, open '/ Users/ogw/Library/Caches/heroku/lastrun'
module: @ oclif/config @ 1.6.33
task: runHook init
plugin: heroku
root: /usr/local/Cellar/heroku/7.7.8/libexec
See more details with DEBUG = *
 ›Warning: log is not a heroku command.
[Y/n]: {[Error: EACCES: permission denied, open '/Users/ogw/Library/Caches/heroku/error.log']
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/Users/ogw/Library/Caches/heroku/error.log'}
{[Error: EACCES: permission denied, open '/Users/ogw/Library/Caches/heroku/error.log']
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/Users/ogw/Library/Caches/heroku/error.log'}
 ›Error: Run heroku help for a list of available commands.
{[Error: EACCES: permission denied, open '/Users/ogw/Library/Caches/heroku/error.log']
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/Users/ogw/Library/Caches/heroku/error.log'}
$heroku --version
(node: 75404) [EACCES] Error Plugin: heroku: EACCES: permission denied, open '/ Users/ogw/Library/Caches/heroku/lastrun'
module: @ oclif/config @ 1.6.33
task: runHook init
plugin: heroku
root: /usr/local/Cellar/heroku/7.7.8/libexec
See more details with DEBUG = *
heroku/7.7.8 darwin-x64 node-v10.7.0
Tried

The command below did not change.
$sudo heroku log
$heroku log --app app_name

Supplemental information (FW/tool version etc.)

$npm --version
6.2.0

What to do when permission denied in npm [mac]
After learning the above article and examining the path, it was/usr/local.

  • Answer # 1

    Since it is a permission error, I think there are other things to try, but let's reinstall it.

    https://devcenter.heroku.com/articles/heroku-cli

    Assuming you put it in npm, it's also deprecated Heroku officially, so

    npm uninstall -g heroku

    Unplug once.

    Isn't it easy to re-enter with

    brew?

    brew install heroku