gpt4 book ai didi

node.js - 'heroku local' 找不到模块 'load-foreman-procfile'

转载 作者:搜寻专家 更新时间:2023-11-01 00:27:17 31 4
gpt4 key购买 nike

我正在尝试通过“heroku local”在本地运行 Heroku 应用程序,但在 Heroku CLI 中出现模块丢失错误。这是一个只需要报告的 Heroku 错误,还是我的机器 (mac) 上的设置有问题?任何建议表示赞赏。

为了确保我的应用程序没有问题,我一直在使用 Heroku 在其入门指南中提供的 Node 应用程序调试此问题。意思是,它已经有一个可以使用默认设置运行的 Procfile。

我尝试过的事情:

  • 为应用程序和 CLI 重新安装 Node 模块
  • 重新安装 Heroku CLI

这是错误:

node-js-getting-started [master] :> heroku local
Error: Cannot find module '../../load-foreman-procfile'
at Object.<anonymous> (/usr/local/Cellar/heroku/7.26.1/libexec/node_modules/@heroku-cli/plugin-local/lib/commands/local/index.js:5:18)

上述路线的文件需要像这样的“load-foreman-procfile”:

const Procfile = require('../../load-foreman-procfile');

该要求路径不会指向该名称的目标文件。事实上,这是我在“/usr/local/Cellar/heroku/7.26.1”中可以找到的对“load-foreman-procfile”的唯一引用。

我希望 heroku local 生成一个通过我的 Procfile 启动的正在运行的本地服务器,而不是上面的错误代码。

最佳答案

我在运行 heroku-cli v7.26.0 时遇到了同样的错误。我切换到他们的边缘 channel (当前 v7.26.2),之后 heroku local 为我工作。

关于node.js - 'heroku local' 找不到模块 'load-foreman-procfile',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56795014/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com