0

When I install node-opus and discord.js on Heroku and then run npm list via heroku run bash I get the following warning:

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

How can I resolve this?

Here is my 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"
  }
}
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
FeAr
  • 13
  • 2
  • 1
    This isn't the core problem, but are you running `npm i node-opus` via `heroku run bash`? You can't install things this way on Heroku, even if it builds successfully. That's a one-off dyno with its own filesystem. And even if it did affect other dynos your changes would be lost the next time each dyno restarts. You'll need to add `node-opus` as a dependency and let Heroku build it during regular slug compilation. – ChrisGPT was on strike Mar 22 '19 at 21:02
  • https://pastebin.com/59DsqssB – FeAr Mar 22 '19 at 22:40
  • We're not going to go off-site just to understand your question; it should be self-contained. Please [edit] your question and include relevant information there. – ChrisGPT was on strike Mar 22 '19 at 22:53
  • I've just successfully installed `node-opus` on a new Heroku app using Yarn (with `package.json` and `yarn.lock`) and using NPM (with `package.json` and package-lock.json`). Neither required any special action. Are you using the latest stack (`heroku-18`)? Are you using the standard `heroku/nodejs` buildpack? (Please edit the relevant information into your question. Again, we're not going to go off-site and dig through logs for you.) – ChrisGPT was on strike Mar 23 '19 at 01:32
  • i just start a new node app and i have node-opus as dependency in packages tried even to add npm i node-opus to scripts but it ends up giving that warning `warning: this use of "defined" may not be portable [-Wexpansion-to-defined]` on every opus file it tries to install during build and after it builds with "succes" when i tpe in bash npm list i get `npm ERR! peer dep missing: node-opus@^0.2.7, required by discord.js@11.4.2` – FeAr Mar 24 '19 at 00:41
  • And it's not working? Please [edit] your question and show us your `package.json` and whichever lock file you're using. – ChrisGPT was on strike Mar 24 '19 at 00:43
  • Wait, this looks like a _completely_ different issue now. It's building successfully but not doing what you want? Is this a new problem? – ChrisGPT was on strike Mar 24 '19 at 00:44
  • I have no idea what this is. package.json `{ "name": "botname", "description": "description", "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" } }` – FeAr Mar 24 '19 at 01:31
  • package-lock.json (only node-opus cuz long) `"node-opus": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/node-opus/-/node-opus-0.3.1.tgz", "integrity": "sha512-1Cb8OvHhdDspVfeKMjEgbedJabyE1Ib6OcN2BMEsRCU7FIsciuBpOErcie3y0qTf83nclPAY+kBU3Oj+U+oRlQ==", "requires": { "bindings": "~1.2.1", "commander": "^2.9.0", "nan": "^2.10.0", "ogg-packet": "^1.0.0" }, "dependencies": { "commander": { "version": "2.19.0",` (not whole cuz cant put more characters here – FeAr Mar 24 '19 at 01:33
  • Please _[edit] your question_ and put the files there. They're impossible to read in comments. – ChrisGPT was on strike Mar 24 '19 at 01:48
  • idk if its even possible to upload files here so i made new repo https://github.com/fearek/packages – FeAr Mar 24 '19 at 12:41
  • I don't know why you continue to ignore what you're being told. We have rules and guidelines here, and things work best when everybody follows them. _**Again**, we're not going to go off-site to read your code._ GitHub is just as inappropriate as Pastebin. Questions should be self-contained so they're useful to other people who have the same problem in the future. _For the **last time**, please [edit] this question and include the relevant code **here**._ You can use this [formatting guide](https://stackoverflow.com/help/formatting). Files and log output should be marked as code blocks. [ask]. – ChrisGPT was on strike Mar 24 '19 at 12:48
  • Thank you for updating your question, though now it looks like you've completely changed it. Originally you asked about a build error but now it looks like you're asking about a warning when you run `npm list`. These are _entirely_ different problems. Generally speaking, please don't completely change questions. If you have a new one, ask a new one. In any case, I've updated your question based on what I think you're actually asking now, and provided an answer. I hope this helps. Please make sure to read https://stackoverflow.com/help/someone-answers – ChrisGPT was on strike Mar 24 '19 at 15:40

1 Answers1

0

I am currently having the same issue, it seems to be something about opus and heroku.

Have you tried installed build these buildpacks?

You can install them on the settings tab on the right side of your app, scroll down and add these buildpacks: 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

Let me know if it did change anything

ferluis
  • 122
  • 1
  • 7