错误:找不到模块“@discordjs/opus”

2024-04-29

每次我运行不和谐的语音识别代码时,它都会上线,但一旦加入频道,我的代码就会显示错误:找不到模块“@discordjs/opus”

Require stack:
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\util\loader.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\Opus.js  
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\index.js 
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\index.js      
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BasePlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BroadcastAudioPlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\VoiceBroadcast.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\Client.js      
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\index.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\index.js
Error: Cannot find module 'node-opus'
Require stack:
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\util\loader.js       
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\Opus.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\index.js        
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\index.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BasePlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BroadcastAudioPlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\VoiceBroadcast.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\Client.js      
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\index.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\index.js
Error: Cannot find module 'opusscript'
Require stack:
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\util\loader.js       
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\Opus.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\index.js        
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\index.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BasePlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BroadcastAudioPlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\VoiceBroadcast.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\Client.js      
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\index.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\index.js
2021-01-26T04:50:28.411Z :: discordClient message: Error: Error: Cannot find module '@discordjs/opus'
Require stack:
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\util\loader.js       
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\Opus.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\index.js        
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\index.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BasePlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BroadcastAudioPlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\VoiceBroadcast.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\Client.js      
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\index.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\index.js
Error: Cannot find module 'node-opus'
Require stack:
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\util\loader.js       
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\Opus.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\index.js        
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\index.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BasePlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BroadcastAudioPlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\VoiceBroadcast.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\Client.js      
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\index.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\index.js
Error: Cannot find module 'opusscript'
Require stack:
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\util\loader.js       
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\Opus.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\opus\index.js        
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\prism-media\src\index.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BasePlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\player\BroadcastAudioPlayer.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\VoiceBroadcast.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\client\Client.js      
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\discord.js\src\index.js
- C:\Users\SURYASH\Desktop\DiscordSpeechBot\index.js

另外,在安装所需的模块/库时,它显示它无法安装不和谐/作品

> @discordjs/[email protected] /cdn-cgi/l/email-protection install C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\@discordjs\opus
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/discordjs/opus/releases/download/v0.1.0/opus-v0.1.0-node-v83-win32-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for @discordjs/[email protected] /cdn-cgi/l/email-protection and [email protected] /cdn-cgi/l/email-protection (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
gyp ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack     at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:315:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:327:5)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)  
gyp ERR! stack     at onErrorNT (internal/child_process.js:465:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:80:21)       
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\SURYASH\\Desktop\\DiscordSpeechBot\\node_modules\\@discordjs\\opus\\prebuild\\node-v83-win32-x64\\opus.node" "--module_name=opus" "--module_path=C:\\Users\\SURYASH\\Desktop\\DiscordSpeechBot\\node_modules\\@discordjs\\opus\\prebuild\\node-v83-win32-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\@discordjs\opus
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program 
Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\@discordjs\opus\prebuild\node-v83-win32-x64\opus.node --module_name=opus --module_path=C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\@discordjs\opus\prebuild\node-v83-win32-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Windows_NT 10.0.18363
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\SURYASH\\Desktop\\DiscordSpeechBot\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\@discordjs\opus  
node-pre-gyp ERR! node -v v14.15.4
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\@discordjs\opus\prebuild\node-v83-win32-x64\opus.node --module_name=opus --module_path=C:\Users\SURYASH\Desktop\DiscordSpeechBot\node_modules\@discordjs\opus\prebuild\node-v83-win32-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @discordjs/[email protected] /cdn-cgi/l/email-protection install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @discordjs/[email protected] /cdn-cgi/l/email-protection install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\SURYASH\AppData\Roaming\npm-cache\_logs\2021-01-26T04_57_11_574Z-debug.log

所以最终我的机器人代码需要 opus 模块,但不知何故它无法安装它。


尝试这个:

npm install discordjs/opus

当某个用户是发言人时,尝试让我的 Discord js 机器人播放 .mp3 文件时,我遇到了同样的问题“错误:找不到模块‘@discordjs/opus’”

通过观看这个视频找到了这个解决方案。youtube.com/watch?v=WXohhIJ1-f4 http://youtube.com/watch?v=WXohhIJ1-f4

如果您不想点击链接,只需在 youtube 上搜索“如何在语音通道 Discord js 中播放音频”即可!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

错误:找不到模块“@discordjs/opus” 的相关文章

  • GraphQL 预期可迭代,但未找到字段 xxx.yyy 的迭代

    我目前正在尝试使用 NodeJS 进行 GraphQL 但我不知道为什么以下查询会出现此错误 library name user name email 我不确定是否type of my resolveLibrary是对的 因为在任何例子中我
  • 如何使用 Chai Http 发布对象数组

    我正在尝试发布一个对象数组ChaiHttp https github com chaijs chai http像这样 agent post route to api send locations lat lat1 lon lon1 lat
  • 限制可选 DOM 复选框

    我试图限制用户可以选择的复选框数量 这些复选框是为数组中的每个项目生成的 DOM 输入对象 我目前对此没有运气 因此非常感谢任何帮助 谢谢 在这里小提琴 http jsfiddle net vVxM2 222 http jsfiddle n
  • 当尝试将 formData 发送到 Express js 时,服务器无法识别 multipart/form-data

    我正在尝试将表单数据上传到快递服务器 在我的 Express js 服务器上 我有以下内容 router post uploads id function req res res send req body const title req
  • 以一定时间间隔连续重复运行 JavaScript 函数

    这是我的第一个问题 希望您尽快回答 我想要代码连续重复一个函数 我尝试了一些代码 但没有成功 我尝试了这段代码 我想在一段时间后重复这个功能 我努力了setInterval and setTimeout 但是 我还没有收到结果 这将重复该任
  • 确定元素是在页面折叠上方还是下方

    我有一些页面有多个输入框 用户可以在其中输入文本 在单击 下一步 按钮之前 需要填写其中一些内容 我弹出验证错误供用户查看 但是如果问题不在页面上 我希望页面滚动到它 而不是他们必须搜索丢失 错误的字段 我有一个滚动到位 但我无法确定要滚动
  • Nodejs - 检查隐藏文件

    我正在迭代文件目录 想知道是否可以测试文件是否隐藏 目前 我只是检查文件是否以 开头或不 这适用于 Mac 也许还有 Linux 但是 我想知道如何在 Windows 上做到这一点 另外 句点会在所有版本的 Linux 中隐藏该文件吗 Th
  • Docker - SequelizeConnectionRefusedError:连接 ECONNREFUSED 127.0.0.1:3306

    我正在尝试使用 Docker 容器启动并运行我的 Nodejs 应用程序 我不知道可能出了什么问题 当我使用控制台调试凭据时 凭据似乎已正确传递 另外启动sequel pro并使用相同的用户名和密码直接连接似乎也可行 当节点在容器中启动时
  • 安装后如何使用 npm 包 (chart.js)?

    我正在制作一个练习 Laravel 站点 并且我已经通过 npm install 安装了 Chart js 这是一个愚蠢的问题 但现在我如何从这里使用它 或通过 npm 安装的任何东西 这些文件安装在节点模块文件夹中 我应该在页眉中使用标签
  • 为什么 Web Worker 性能在 30 秒后急剧下降?

    我正在尝试提高在网络工作人员中执行时脚本的性能 它旨在解析浏览器中的大型文本文件而不会崩溃 一切都运行得很好 但我注意到使用网络工作者时大文件的性能存在严重差异 于是我做了一个简单的实验 我在同一输入上运行脚本两次 第一次运行在页面的主线程
  • 在管道中重用变量的功能方式

    在 javascript 和 typescript 中与 Ramda 一起使用函数式编程 我经常发现自己编写如下代码 const myFun c gt const myId c id const value pipe getAnotherO
  • 如何处理requireJs超时错误?

    我正在使用 require js 作为加载框架编写一个移动混合应用程序 我遇到加载错误的问题 我想做的是在设备离线且无法下载在屏幕上显示地图所需的 google 地图 API 脚本时设置后备解决方案 我得到的只是 Uncaught Erro
  • Node.js 未处理的“错误”事件

    我编写了一个简单的代码并将其保存在文件 try js 中 var http require http var makeRequest function message var options host localhost port 8080
  • 使用 AngularJS 多部分表单数据将文件上传到 Google Cloud Storage

    我正在尝试使用 AngularJS 中指定的多部分方法将图像文件上传到 Google Cloud Storagehttps cloud google com storage docs json api v1 how tos upload m
  • RoR - Rails 中的大文件上传

    我有一个 Rails Web 应用程序 允许用户上传视频 视频存储在 NFS 安装的目录中 当前的设置适用于较小的文件 但我也需要支持大文件上传 最多 4GB 当我尝试上传 4GB 文件时 它最终会发生 但从用户体验的角度来看很糟糕 上传开
  • mozilla pdf.js 没有全视图

    我喜欢这个 pdf 查看器https github com mozilla pdf js https github com mozilla pdf js Demo http mozilla github com pdf js web vie
  • MongoDB中如何通过引用字段进行查询?

    我有两个 Mongo 模式 User id ObjectId name String country ObjectId Reference to schema Country Country id ObjectId name String
  • 如何使用 jQuery 或 JavaScript 聚焦 或 标签?

    for var i 0 i
  • 如何执行“sudo nvm”?

    在我的 Mac 上 我想将一些需要 su 权限的包迁移到另一个节点版本 我使用 homebrew 安装 nvm 现在我需要执行 sudo nvm 或 reinstall packages将失败 me MacBook sudo nvm sud
  • 无法使用 HTML 设置未定义 jQuery UI 自动完成的属性“_renderItem”

    我使用以下代码将 jQuery UI 自动完成项呈现为 HTML 这些项目在自动完成控件中正确呈现 但我不断收到此 JavaScript 错误并且无法移动过去 Firefox 无法转换 JavaScript 参数 Chrome 无法设置未定

随机推荐