discordjs / opus

Native opus bindings for node
MIT License
188 stars 53 forks source link

Issue Installing discordjs/opus #124

Closed Harrsn closed 2 years ago

Harrsn commented 2 years ago

Trying to install discordjs/opus, I'm using npm i @discordjs/opus to try to install it.

Below is the error message I get in Powershell after issuing the command. If Complete Log is needed, feel free to let me know! Note: Using Powershell with Administrator Priv

PS C:\WINDOWS\system32> npm i @discordjs/opus

npm ERR! code 1

npm ERR! path C:\WINDOWS\system32\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! MSBUILD : error MSB1009: Project file does not exist.

npm ERR! Switch: build/binding.sln

npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\WINDOWS\system32\node_modules\@discordjs\opus\prebuild\node-v102-napi-v3-win32-x64-unknown-unknown\opus.node --module_name=opus --module_path=C:\WINDOWS\system32\node_modules\@discordjs\opus\prebuild\node-v102-napi-v3-win32-x64-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@17.8.0 | win32 | x64

npm ERR! node-pre-gyp info check checked for "C:\WINDOWS\system32\node_modules\@discordjs\opus\prebuild\node-v102-napi-v3-win32-x64-unknown-unknown\opus.node" (not found)

npm ERR! node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.7.0/opus-v0.7.0-node-v102-napi-v3-win32-x64-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.7.0/opus-v0.7.0-node-v102-napi-v3-win32-x64-unknown-unknown.tar.gz

npm ERR! node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.7.0 and node@17.8.0 (node-v102 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.7.0/opus-v0.7.0-node-v102-napi-v3-win32-x64-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@17.8.0 | win32 | x64

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@17.8.0 | win32 | x64

npm ERR! gyp info find Python using Python version 3.10.4 found at "C:\Python310\python.exe"

npm ERR! gyp http GET https://nodejs.org/download/release/v17.8.0/node-v17.8.0-headers.tar.gz

npm ERR! gyp http 200 https://nodejs.org/download/release/v17.8.0/node-v17.8.0-headers.tar.gz

npm ERR! gyp http GET https://nodejs.org/download/release/v17.8.0/SHASUMS256.txt

npm ERR! gyp http GET https://nodejs.org/download/release/v17.8.0/win-x86/node.lib

npm ERR! gyp http GET https://nodejs.org/download/release/v17.8.0/win-x64/node.lib

npm ERR! gyp http GET https://nodejs.org/download/release/v17.8.0/win-arm64/node.lib

npm ERR! gyp http 200 https://nodejs.org/download/release/v17.8.0/SHASUMS256.txt

npm ERR! gyp http 404 https://nodejs.org/download/release/v17.8.0/win-arm64/node.lib

npm ERR! gyp http 200 https://nodejs.org/download/release/v17.8.0/win-x86/node.lib

npm ERR! gyp http 200 https://nodejs.org/download/release/v17.8.0/win-x64/node.lib

npm ERR! gyp info find VS using VS2017 (15.9.28307.1831) found at:

npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"

npm ERR! gyp info find VS run with --verbose for detailed information

npm ERR! gyp info spawn C:\Python310\python.exe

npm ERR! gyp info spawn args [

npm ERR! gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',

npm ERR! gyp info spawn args   'binding.gyp',

npm ERR! gyp info spawn args   '-f',

npm ERR! gyp info spawn args   'msvs',

npm ERR! gyp info spawn args   '-I',

npm ERR! gyp info spawn args   'C:\\WINDOWS\\system32\\node_modules\\@discordjs\\opus\\build\\config.gypi',

npm ERR! gyp info spawn args   '-I',

npm ERR! gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',

npm ERR! gyp info spawn args   '-I',

npm ERR! gyp info spawn args   'C:\\Users\\harry\\AppData\\Local\\node-gyp\\Cache\\17.8.0\\include\\node\\common.gypi',

npm ERR! gyp info spawn args   '-Dlibrary=shared_library',

npm ERR! gyp info spawn args   '-Dvisibility=default',

npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\harry\\AppData\\Local\\node-gyp\\Cache\\17.8.0',

npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',

npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\harry\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\17.8.0\\\\<(target_arch)\\\\node.lib',

npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\WINDOWS\\system32\\node_modules\\@discordjs\\opus',

npm ERR! gyp info spawn args   '-Dnode_engine=v8',

npm ERR! gyp info spawn args   '--depth=.',

npm ERR! gyp info spawn args   '--no-parallel',

npm ERR! gyp info spawn args   '--generator-output',

npm ERR! gyp info spawn args   'C:\\WINDOWS\\system32\\node_modules\\@discordjs\\opus\\build',

npm ERR! gyp info spawn args   '-Goutput_dir=.'

npm ERR! gyp info spawn args ]

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@17.8.0 | win32 | x64

npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe

npm ERR! gyp info spawn args [

npm ERR! gyp info spawn args   'build/binding.sln',

npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',

npm ERR! gyp info spawn args   '/nologo',

npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'

npm ERR! gyp info spawn args ]

npm ERR! gyp ERR! build error

npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1

npm ERR! gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)

npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)

npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

npm ERR! gyp ERR! System Windows_NT 10.0.19042

npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\WINDOWS\\system32\\node_modules\\@discordjs\\opus\\prebuild\\node-v102-napi-v3-win32-x64-unknown-unknown\\opus.node" "--module_name=opus" "--module_path=C:\\WINDOWS\\system32\\node_modules\\@discordjs\\opus\\prebuild\\node-v102-napi-v3-win32-x64-unknown-unknown" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"

npm ERR! gyp ERR! cwd C:\WINDOWS\system32\node_modules\@discordjs\opus

npm ERR! gyp ERR! node -v v17.8.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\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\WINDOWS\system32\node_modules\@discordjs\opus\prebuild\node-v102-napi-v3-win32-x64-unknown-unknown\opus.node --module_name=opus --module_path=C:\WINDOWS\system32\node_modules\@discordjs\opus\prebuild\node-v102-napi-v3-win32-x64-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:\Windows\System32\node_modules\@discordjs\node-pre-gyp\lib\util\compile.js:85:20)

npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:527:28)

npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1090: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.19042

npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Windows\\System32\\node_modules\\@discordjs\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"

npm ERR! node-pre-gyp ERR! cwd C:\WINDOWS\system32\node_modules\@discordjs\opus

npm ERR! node-pre-gyp ERR! node -v v17.8.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\harry\AppData\Local\npm-cache\_logs\2022-03-25T22_16_12_177Z-debug-0.log

I've been trying for the past hour or two to wrap my head around this. Multiple Google searches were no help. Any help at all would be much appreciated!

THE-bedt commented 2 years ago

Yea i got the same problem, and i didn't got any solution

97Lucaas commented 2 years ago

me as well !

GabeDahl commented 2 years ago

I have the same issue while installing on a Linux docker image. Installation and usage work fine in my Windows desktop environment.

sahsudhanshu commented 2 years ago

did you got any solution for it

phamleduy04 commented 2 years ago

If you on Windows, you need to install C++ build tools. Install Visual Studio Community and when install also check the option Desktop development with C++.

image

On Linux you need to install build-essential using your package manager.

DanielBUBU commented 2 years ago

If you on Windows, you need to install C++ build tools. Install Visual Studio Community and when install also check the option Desktop development with C++.

image

On Linux you need to install build-essential using your package manager.

It's not working for me tho

phamleduy04 commented 2 years ago

It's not working for me tho

Any errors pop up? @DanielBUBU

DanielBUBU commented 2 years ago

It's not working for me tho

Any errors pop up? @DanielBUBU

I was using linux emulator "termux" on my android phone, and I create another issue because it's a special OS https://github.com/discordjs/opus/issues/127

phamleduy04 commented 2 years ago

It's not working for me tho

Any errors pop up? @DanielBUBU

I was using linux emulator "termux" on my android phone, and I create another issue because it's a special OS #127

Did you install build-essential on termux? (I think termux use pkg to install so try pkg install build-essential)

DanielBUBU commented 2 years ago

It's not working for me tho

Any errors pop up? @DanielBUBU

I was using linux emulator "termux" on my android phone, and I create another issue because it's a special OS #127

Did you install build-essential on termux? (I think termux use pkg to install so try pkg install build-essential)

yeah I did