prism-media: Could not find an Opus module! Please install node-opus or opusscript
Issue:
I have installed opusscript, but still it shows Could not find an Opus module! Please install node-opus or opusscript
. I am using this on a discord bot. First it works fine. No error is there, then after sometime, this error starts arising even though opusscript is installed. Then when i restart the bot, it starts working again. Then after sometime the same thing happens again.
Further details:
- Operating System: Linux
- Node.js version: 10.x
- Commit I’m using: prism-media-1.1.0
Edit: My opusscript version is 0.0.7
, is that supposed to be the cause of problem.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 33 (7 by maintainers)
+1
If it helps, I just solved this problem:
The only thing I have done has been to install the packages:
At least with these dependencies ytdl-core is working for me. Regards!
Hello @amishshah.
I had this running for about a year. I had to restart it a few times.
It eventually stopped working all together and I was using very outdated versions.
I updated everything from system core all the way to Discordjs/opus and prism-media.
I preformed the node > require(“@discordjs/opus”);
and it returned this:
{ OpusEncoder: [Function: OpusEncoder] }
when I run it I get this error:
Please install @discordjs/opus, node-opus, or opusscript. Error: Could not find an Opus module! Please install @discordjs/opus, node-opus, or opusscript. at new OpusStream (/node_modules/prism-media/src/opus/Opus.js:42:13) at new Decoder (/node_modules/prism-media/src/opus/Opus.js:164:1) at AudioPlayer.playOpusStream (/node_modules/discord.js/src/client/voice/player/BasePlayer.js:73:23) at VoiceConnection.play (/node_modules/discord.js/src/client/voice/util/PlayInterface.js:78:28)
many guidance to solve this would be much appreciated.
Thx.
I have one last question. This is about GitHub. I have very little insight into how it works. In my package.json I have two GitHub references:
“discord.js”: “github:discordjs/discord.js”, “express”: “^4.17.1”, “ffmpeg-static”: “^4.0.1”, “moment”: “^2.24.0”, “mongodb”: “^3.3.5”, “nodemon”: “^2.0.1”, “prism-media”: “github:amishshah/prism-media”,
I had everything installed and working and then all by itself everything died. Do these two gihub references in the package.json cause updates to be automatically pushed to my install? Cause one day it is working, I go to bed, get up, and everything is broken. If things are auto pushed, how do I prevent this from happening again in the future?
Thanks
installing oppusscript did the trick for me, thank you!