Can not install @discordjs/opus in build/local environment
riflowth opened this issue · 6 comments
Please describe the problem you are having in as much detail as possible:
I cannot install @discordjs/opus
on GitHub Action build environment
with the latest ubuntu and in my local machines MacOS / WIndow.
Build logs: https://github.com/riflowth/tier-discord-bot/runs/7052114942?check_suite_focus=true#step:6:268
Notes
It can install the dependencies successfully before this day.
But today, it cannot install @discordjs/opus successfully
without any changes of dependencies / lockfile / dockerfile / application code.
Source code: https://github.com/riflowth/tier-discord-bot/
- @discordjs/opus version: 0.7.0
- Node.js version: 16
- Operating system: Latest ubuntu on GitHub Action / MacOS Monterey 12.4 (M1 Pro) / Window 11
Same issue here:
- Was running in Windows PowerShell
- Command was npm install @discordjs/opus
- Node.js version: 16
Error log
npm ERR! code 1
npm ERR! path C:\projects\honeyBeeMusic\node_modules\@discordjs\opus
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\Sally\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\projects\honeyBeeMusic\node_modules\@discordjs\opus\prebuild\node-v93-napi-v3-win32-ia32-unknown-unknown\opus.node --module_name=opus --module_path=C:\projects\honeyBeeMusic\node_modules\@discordjs\opus\prebuild\node-v93-napi-v3-win32-ia32-unknown-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.4.2
npm ERR! node-pre-gyp info using node@16.14.0 | win32 | ia32
npm ERR! node-pre-gyp info check checked for "C:\projects\honeyBeeMusic\node_modules\@discordjs\opus\prebuild\node-v93-napi-v3-win32-ia32-unknown-unknown\opus.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.5.3/opus-v0.5.3-node-v93-napi-v3-win32-ia32-unknown-unknown.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.5.3/opus-v0.5.3-node-v93-napi-v3-win32-ia32-unknown-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.5.3 and node@16.14.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.5.3/opus-v0.5.3-node-v93-napi-v3-win32-ia32-unknown-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@16.14.0 | win32 | ia32
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@16.14.0 | win32 | ia32
npm ERR! gyp info find Python using Python version 3.9.7 found at "C:\Users\Sally\AppData\Local\Programs\Python\Python39\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Users\Sally\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack at C:\Users\Sally\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\Sally\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
npm ERR! gyp ERR! stack at C:\Users\Sally\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR! stack at C:\Users\Sally\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:384:16
npm ERR! gyp ERR! stack at C:\Users\Sally\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at C:\Users\Sally\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:406:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1092:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Sally\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\projects\\honeyBeeMusic\\node_modules\\@discordjs\\opus\\prebuild\\node-v93-napi-v3-win32-ia32-unknown-unknown\\opus.node" "--module_name=opus" "--module_path=C:\\projects\\honeyBeeMusic\\node_modules\\@discordjs\\opus\\prebuild\\node-v93-napi-v3-win32-ia32-unknown-unknown" "--nnpm ERR! gyp ERR! cwd C:\projects\honeyBeeMusic\node_modules\@discordjs\opus
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\Sally\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\projects\honeyBeeMusic\node_modules\@discordjs\opus\prebuild\node-v93-napi-v3-win32-ia32-unknown-unknown\opus.node --module_name=opus --module_path=C:\projects\honeyBeeMusic\node_modules\@discordjs\opus\prebuild\node-v93-napi-v3-win32-ia32-unknown-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\projects\honeyBeeMusic\node_modules\@discordjs\node-pre-gyp\lib\util\compile.js:85:20)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1092:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19044
npm ERR! node-pre-gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\projects\\honeyBeeMusic\\node_modules\\@discordjs\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd C:\projects\honeyBeeMusic\node_modules\@discordjs\opus
npm ERR! node-pre-gyp ERR! node -v v16.14.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.4.2
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Sally\AppData\Local\npm-cache\_logs\2022-06-26T11_29_26_017Z-debug-0.log
Have you tried following the instructions in your error logs?
#12 18.73 gyp ERR! find Python **********************************************************
#12 18.73 gyp ERR! find Python You need to install the latest version of Python.
#12 18.73 gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#12 18.73 gyp ERR! find Python you can try one of the following options:
#12 18.73 gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
#12 18.73 gyp ERR! find Python (accepted by both node-gyp and npm)
#12 18.73 gyp ERR! find Python - Set the environment variable PYTHON
#12 18.73 gyp ERR! find Python - Set the npm configuration variable python:
#12 18.73 gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
#12 18.73 gyp ERR! find Python For more information consult the documentation at:
#12 18.73 gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
#12 18.73 gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
Thanks for helping, and yes, I already tried, but unfortunately it doesn't work well for me. Reinstalling the latest VS gave me the exact same error.
For me it is trying to download opus-v0.7.0-node-v93-napi-v3-linux-x64-glibc-2.35.tar.gz
but that fiile is not released. Instead, it should be downloading opus-v0.7.0-node-v93-napi-v3-linux-x64-glibc-2.31.tar.gz
which does exist.
As you can see glibc version is not the same.
Ubuntu 22.04 ships with 2.35 but 2.31 is required which is the version default on 20.04.
Nothing is required, but we can only supply pre-builds for so many different versions.
If we don’t provide one, its still possible to locally build it yourself just fine, which is the step after the download fails or it can’t find the specific file you requested.
@iCrawl
I have fixed the problem with this solution riflowth/tier-discord-bot@51e1e1e on Dockerfile