如何解决 Heroku 上的 "peer dep missing" 问题?

How to resolve "peer dep missing" issue on Heroku?

当我在 Heroku 上安装 node-opusdiscord.js,然后通过 heroku run bash 安装 运行 npm list 时,我收到以下警告:

npm ERR! peer dep missing: node-opus@^0.2.7, required by discord.js@11.4.2

我该如何解决这个问题?

这是我的 package.json:

{
  "name": "PrzegrywBOT",
  "description": "PrzegrywBOT",
  "version": "2.0.0",
  "engines": {
    "node": "10.15.0"
  },
  "main": "index.js",
  "scripts": {
    "start": "node index.js"
  },
  "dependencies": {
    "cheerio": "^1.0.0-rc.2",
    "discord.js": "^11.4.2",
    "ffmpeg": "0.0.4",
    "ffmpeg-binaries": "^4.0.0",
    "node-opus": "^0.3.1",
    "request": "^2.88.0",
    "simple-youtube-api": "^5.1.1",
    "superagent": "^4.1.0",
    "ytdl-core": "^0.29.1"
  }
}

我现在遇到了同样的问题,好像是关于opus和heroku的问题。

您是否尝试安装构建这些构建包?

您可以在应用右侧的设置选项卡上安装它们,向下滚动并添加这些构建包: https://elements.heroku.com/buildpacks/jonathanong/heroku-buildpack-ffmpeg-latest https://elements.heroku.com/buildpacks/dubsmash/heroku-buildpack-opus https://elements.heroku.com/buildpacks/crazycatz00/heroku-buildpack-libopus

如果它确实改变了什么,请告诉我