【问题标题】:Heroku command error .local/share/heroku/client/bin/heroku: line 21:Heroku 命令错误 .local/share/heroku/client/bin/heroku:第 21 行:
【发布时间】:2018-10-08 09:06:00
【问题描述】:

我的 heroku 工具带一直运行良好,直到上周它在所有 heroku 命令上都给我这个错误。

$ heroku run console -a abc
/Users/songserm/.local/share/heroku/client/bin/heroku: line 21: /Users/songserm/.local/share/heroku/client/bin/node: No such file or directory
/Users/songserm/.local/share/heroku/client/bin/heroku: line 21: /Users/songserm/.local/share/heroku/client/bin/node: No such file or directory

我不知道我的 heroku 已经自动升级,但改变的是我安装了 heroku-vi 插件。不确定是不是这样。

以前有人见过这个问题吗?

注意到我使用自制软件在我的 Mac 上安装了 heroku。

【问题讨论】:

    标签: heroku


    【解决方案1】:

    原因:

    这也发生在我身上,客户端自动更新但没有正确更新:

    heroku run console
    heroku-cli: Updating to 6.11.14-c5f9179... 12.9 MB/12.9 MB
    /Users/steves/.local/share/heroku/client/bin/heroku: line 21: /Users/steves/.local/share/heroku/client/bin/node: No such file or directory
    /Users/steves/.local/share/heroku/client/bin/heroku: line 21: /Users/steves/.local/share/heroku/client/bin/node: No such file or directory
    

    解决方案:

    解决方案是使用以下内容重新安装客户端(如在此处找到 https://github.com/heroku/cli/issues/485):

    rm -rf ~/.local/share/heroku/client
    

    然后我使用状态命令检查并正确重新安装:

    heroku status
    heroku-cli: Updating to 6.11.14-c5f9179... 12.9 MB/12.9 MB
    Migrating Heroku CLI v5 plugins... done
    Apps:      No known issues at this time.
    Data:      No known issues at this time.
    Tools:     No known issues at this time.
    

    【讨论】:

    • 感谢编辑,我不知道为什么我最初没有使用 ~。
    • 我在将 Mac OS 更新到 High Sierra 后遇到了这个问题。我很高兴找到这个快速解决方案!
    • 太棒了!不错的收获! :)
    【解决方案2】:

    Heroku-error-Not a directory

    执行 Heroku 命令时不是目录错误

    heroku
    ▸   stat /User/xxx/.local/share/heroku/client/bin/heroku: not a directory
    ▸   fork/exec /User/xxx/.local/share/heroku/client/bin/heroku: not a directory
    

    解决方法是删除之前的目录

    rm -rf ~/.local/share/heroku/client
    

    【讨论】:

    • 不是原始问题的答案,但它解决了我的问题。 +1
    • 非常适合我。在我删除文件夹并运行 heroku status 后,Heroku 更新了客户端。
    • 我在从 7.0.12 更新到 7.22.7 时遇到了这个问题,这对我有用。
    【解决方案3】:

    对我来说,一个快速的解决方法是删除此文件。

    rm -rf ~/.local/share/heroku
    

    而且我能够轻松访问 heroku 控制台。

    【讨论】:

      【解决方案4】:

      正如大家所说,解决方案是:

      使用以下控制台命令删除 heroku 客户端:

      rm -rf ~/.local/share/heroku/plugins

      但如果你继续遇到问题,你必须删除 heroku 插件文件夹:

      rm -rf ~/.local/share/heroku/plugins

      然后就可以执行命令了 heroku status

      正确重新安装

      $ heroku 状态

      heroku-cli:更新到 6.99.0-ec9edad... 12.8 MB/12.8 MB

      应用:目前没有已知问题。

      数据:目前没有已知问题。

      工具:目前没有已知问题。

      【讨论】:

        猜你喜欢
        • 2014-12-12
        • 2014-06-07
        • 1970-01-01
        • 1970-01-01
        • 2016-04-07
        • 1970-01-01
        • 2017-05-28
        • 1970-01-01
        • 2020-11-06
        相关资源
        最近更新 更多