codetheweb / muse

🎧 a self-hosted midwestern Discord music bot that doesn't suck
MIT License
799 stars 200 forks source link

Build Error (node-pre-gyp) #991

Closed nauxnam closed 1 month ago

nauxnam commented 5 months ago

Was trying to build the bot but got the error:

$ npm i
npm WARN skipping integrity check for git dependency ssh://git@github.com/khlevon/node-ytdl-core.git 
npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated ytsr@3.8.4: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated vm2@3.9.9: The library contains critical security issues and should not be used for production! The maintenance of the project has been discontinued. Consider migrating your code to isolated-vm.
npm WARN deprecated superagent@6.1.0: Please upgrade to v7.0.2+ of superagent.  We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing.  See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>.
npm ERR! code 1
npm ERR! path /home/foxuser/music-bot/node_modules/@discordjs/opus
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/foxuser/music-bot/node_modules/@discordjs/opus/prebuild/node-v120-napi-v3-linux-x64-glibc-2.36/opus.node --module_name=opus --module_path=/home/foxuser/music-bot/node_modules/@discordjs/opus/prebuild/node-v120-napi-v3-linux-x64-glibc-2.36 --napi_version=9 --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.4
npm ERR! node-pre-gyp info using node@21.6.1 | linux | x64
npm ERR! (node:2824) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! node-pre-gyp info check checked for "/home/foxuser/music-bot/node_modules/@discordjs/opus/prebuild/node-v120-napi-v3-linux-x64-glibc-2.36/opus.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.8.0/opus-v0.8.0-node-v120-napi-v3-linux-x64-glibc-2.36.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.8.0/opus-v0.8.0-node-v120-napi-v3-linux-x64-glibc-2.36.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.8.0 and node@21.6.1 (node-v120 ABI, glibc) (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.8.0/opus-v0.8.0-node-v120-napi-v3-linux-x64-glibc-2.36.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@21.6.1 | linux | x64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@21.6.1 | linux | x64
npm ERR! gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/lib/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 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/foxuser/music-bot/node_modules/@discordjs/opus/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/foxuser/.cache/node-gyp/21.6.1/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=/home/foxuser/.cache/node-gyp/21.6.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/foxuser/.cache/node-gyp/21.6.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/foxuser/music-bot/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 '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@10.0.1
npm ERR! gyp info using node@21.6.1 | linux | x64
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: not found: make
npm ERR! gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/lib/index.js:16:17)
npm ERR! gyp ERR! stack at which (/usr/lib/node_modules/npm/node_modules/which/lib/index.js:77:9)
npm ERR! gyp ERR! stack at async doWhich (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:112:22)
npm ERR! gyp ERR! stack at async loadConfigGypi (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:77:7)
npm ERR! gyp ERR! stack at async build (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:35:3)
npm ERR! gyp ERR! stack at async run (/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:81:18)
npm ERR! gyp ERR! System Linux 6.1.0-17-amd64
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/foxuser/music-bot/node_modules/@discordjs/opus/prebuild/node-v120-napi-v3-linux-x64-glibc-2.36/opus.node" "--module_name=opus" "--module_path=/home/foxuser/music-bot/node_modules/@discordjs/opus/prebuild/node-v120-napi-v3-linux-x64-glibc-2.36" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
npm ERR! gyp ERR! cwd /home/foxuser/music-bot/node_modules/@discordjs/opus
npm ERR! gyp ERR! node -v v21.6.1
npm ERR! gyp ERR! node-gyp -v v10.0.1
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 '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/foxuser/music-bot/node_modules/@discordjs/opus/prebuild/node-v120-napi-v3-linux-x64-glibc-2.36/opus.node --module_name=opus --module_path=/home/foxuser/music-bot/node_modules/@discordjs/opus/prebuild/node-v120-napi-v3-linux-x64-glibc-2.36 --napi_version=9 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/foxuser/music-bot/node_modules/@discordjs/node-pre-gyp/lib/util/compile.js:85:20)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm ERR! node-pre-gyp ERR! System Linux 6.1.0-17-amd64
npm ERR! node-pre-gyp ERR! command "/usr/bin/node" "/home/foxuser/music-bot/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/foxuser/music-bot/node_modules/@discordjs/opus
npm ERR! node-pre-gyp ERR! node -v v21.6.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.4.4
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /home/foxuser/.npm/_logs/2024-01-27T06_57_31_752Z-debug-0.log

Tried installing higher node-gyp version but no luck.

Runtime I'm running Muse:

Versions

codetheweb commented 5 months ago

looks like you probably need to install the build essential package for your distro, you're missing make