【问题标题】:Error: Cannot find module '@heroku/buildpack-registry'错误:找不到模块“@heroku/buildpack-registry”
【发布时间】:2021-11-26 02:16:31
【问题描述】:

我正在尝试在 Heroku 上部署一个 Web 应用程序。我收到以下错误 Error: Cannot find module '@heroku/buildpack-registry' 我尝试添加我正在使用的节点版本,但仍然没有帮助。 我还使用npm i heroku@7.59.0 升级了 Heroku,这也没有帮助。 对此有什么想法吗?

这是我的 package.json

{"name":"gssrDB",
  "engines": {
    "node": "14.18.0"
  }
  ,
  "scripts": {
    "dev": "nodemon index.js",
    "start": "node index.js"
  },
  "dependencies": {
    "@heroku-cli/plugin-buildpacks": "^7.54.0",
    "@heroku/buildpack-registry": "^1.0.1",
    "async-file": "^2.0.2",
    "cli-ux": "^4.9.3",
    "dotenv": "^9.0.2",
    "ejs": "^3.1.6",
    "ejs-mate": "^3.0.0",
    "express": "^4.17.1",
    "got": "^8.3.2",
    "heroku": "^7.59.0",
    "mongodb": "^3.6.6",
    "mongoose": "^5.12.9",
    "nodemon": "^2.0.13",
    "phoenix": "^1.6.0"
  }
}

【问题讨论】:

    标签: node.js mongodb express heroku


    【解决方案1】:

    我在终端这样解决了

    $ heroku plugins:install buildpack-registry
    $ heroku plugins:install buildpacks  
    

    可能有用

    【讨论】:

      【解决方案2】:

      我遇到了类似的问题,我通过使用正确的节点版本解决了它。 对于当前的heroku版本,node16可以工作,否则会导致buildpack出错

      【讨论】:

        【解决方案3】:

        有两件事有助于解决这个问题:

        1. 更新heroku CLI
          npm install -g heroku
          
        2. 在 package.json 中使用当前安装的节点和 npm 版本添加引擎
          "node": "14.18.0",
          "npm": "7.6.3"
          } 
          

        【讨论】:

          猜你喜欢
          • 2022-01-02
          • 2016-10-17
          • 1970-01-01
          • 2021-12-10
          • 2018-09-03
          • 2015-10-31
          • 2022-07-05
          • 2019-04-02
          • 2019-04-10
          相关资源
          最近更新 更多