opus: node-gyp gives me error...

Hello, I tried to install this package by:

npm install @discordjs/opus

but it gives me an error:

gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1gyp ERR! stack     at ChildProcess.onExit (C:\Users\JediCoding\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:284:12)
gyp ERR! System Windows_NT 10.0.19041
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\JediCoding\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=F:\\Groove\\node_modules\\@discordjs\\opus\\prebuild\\node-v88-napi-v3-win32-x64-unknown-unknown\\opus.node" "--module_name=opus" "--module_path=F:\\Groove\\node_modules\\@discordjs\\opus\\prebuild\\node-v88-napi-v3-win32-x64-unknown-unknown" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd F:\Groove\node_modules\@discordjs\opus
gyp ERR! node -v v15.5.1
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:\Users\JediCoding\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=F:\Groove\node_modules\@discordjs\opus\prebuild\node-v88-napi-v3-win32-x64-unknown-unknown\opus.node --module_name=opus --module_path=F:\Groove\node_modules\@discordjs\opus\prebuild\node-v88-napi-v3-win32-x64-unknown-unknown --napi_version=7 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (F:\Groove\node_modules\@discordjs\node-pre-gyp\lib\util\compile.js:72:20)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1063:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
node-pre-gyp ERR! System Windows_NT 10.0.19041
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "F:\\Groove\\node_modules\\@discordjs\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd F:\Groove\node_modules\@discordjs\opus
node-pre-gyp ERR! node -v v15.5.1
node-pre-gyp ERR! node-pre-gyp -v v0.1.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\JediCoding\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=F:\Groove\node_modules\@discordjs\opus\prebuild\node-v88-napi-v3-win32-x64-unknown-unknown\opus.node --module_name=opus --module_path=F:\Groove\node_modules\@discordjs\opus\prebuild\node-v88-napi-v3-win32-x64-unknown-unknown --napi_version=7 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm WARN groove@1.0.0 No description
npm WARN groove@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @discordjs/opus@0.3.3 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @discordjs/opus@0.3.3 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\JediCoding\AppData\Roaming\npm-cache\_logs\2021-01-23T06_41_44_411Z-debug.log

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (5 by maintainers)

Most upvoted comments

@JediThePro It looks like your node-pre-gyp is outdated:

node-pre-gyp ERR! node-pre-gyp -v v0.1.0 node-pre-gyp ERR! not ok

Try to increase your node-pre-gyp and node-gyp versions via:

npm i node-pre-gyp@0.17.0

npm i node-gyp@7.1.2

Then:

npm rebuild

npm i @discordjs/opus

I had a similar error …

try “npm install opusscript”

Downgrade to Node 16.

It is now SOLVED!