简体   繁体   English

Repl.it & Discord.js:无法安装distube package

[英]Repl.it & Discord.js: Cannot install distube package

When I try to install distube package for my music system, it throws an error.当我尝试为我的音乐系统安装distube package 时,它会引发错误。 I gotta say that I'm using NodeJS v16 template and Discord.js v13.我得说我使用的是 NodeJS v16 模板和 Discord.js v13。

The error:错误:

npm ERR! path /home/runner/UnfortunateDistortedEngine/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 '/nix/store/bwxril521b35zlf4x2g32hll64rzfhck-nodejs-16.7.0/bin/node /nix/store/bwxril521b35zlf4x2g32hll64rzfhck-nodejs-16.7.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/runner/UnfortunateDistortedEngine/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-x64-glibc-2.33/opus.node --module_name=opus --module_path=/home/runner/UnfortunateDistortedEngine/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-x64-glibc-2.33 --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.7.0 | linux | x64
npm ERR! node-pre-gyp info check checked for "/home/runner/UnfortunateDistortedEngine/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-x64-glibc-2.33/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-v93-napi-v3-linux-x64-glibc-2.33.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-v93-napi-v3-linux-x64-glibc-2.33.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.7.0 and node@16.7.0 (node-v93 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.7.0/opus-v0.7.0-node-v93-napi-v3-linux-x64-glibc-2.33.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.7.0 | 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@7.1.2
npm ERR! gyp info using node@16.7.0 | linux | x64
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python2" can be used
npm ERR! gyp ERR! find Python - "python2" is not in PATH or produced an error
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (/nix/store/bwxril521b35zlf4x2g32hll64rzfhck-nodejs-16.7.0/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:302:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/nix/store/bwxril521b35zlf4x2g32hll64rzfhck-nodejs-16.7.0/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:136:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/nix/store/bwxril521b35zlf4x2g32hll64rzfhck-nodejs-16.7.0/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:179:16)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/nix/store/bwxril521b35zlf4x2g32hll64rzfhck-nodejs-16.7.0/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:266:16)
npm ERR! gyp ERR! stack     at exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:416:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:477:16)
npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! gyp ERR! System Linux 5.11.0-1023-gcp
npm ERR! gyp ERR! command "/nix/store/bwxril521b35zlf4x2g32hll64rzfhck-nodejs-16.7.0/bin/node" "/nix/store/bwxril521b35zlf4x2g32hll64rzfhck-nodejs-16.7.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/runner/UnfortunateDistortedEngine/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-x64-glibc-2.33/opus.node" "--module_name=opus" "--module_path=/home/runner/UnfortunateDistortedEngine/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-x64-glibc-2.33" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
npm ERR! gyp ERR! cwd /home/runner/UnfortunateDistortedEngine/node_modules/@discordjs/opus
npm ERR! gyp ERR! node -v v16.7.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
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 '/nix/store/bwxril521b35zlf4x2g32hll64rzfhck-nodejs-16.7.0/bin/node /nix/store/bwxril521b35zlf4x2g32hll64rzfhck-nodejs-16.7.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/runner/UnfortunateDistortedEngine/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-x64-glibc-2.33/opus.node --module_name=opus --module_path=/home/runner/UnfortunateDistortedEngine/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-x64-glibc-2.33 --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> (/home/runner/UnfortunateDistortedEngine/node_modules/@discordjs/node-pre-gyp/lib/util/compile.js:85:20)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! node-pre-gyp ERR! System Linux 5.11.0-1023-gcp
npm ERR! node-pre-gyp ERR! command "/nix/store/bwxril521b35zlf4x2g32hll64rzfhck-nodejs-16.7.0/bin/node" "/home/runner/UnfortunateDistortedEngine/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/runner/UnfortunateDistortedEngine/node_modules/@discordjs/opus
npm ERR! node-pre-gyp ERR! node -v v16.7.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!     /home/runner/.npm/_logs/2021-11-30T17_16_44_972Z-debug.log

It seems like I need to install some python related package or anything else before installing distube.在安装 distube 之前,我似乎需要安装一些 python 相关的 package 或其他任何东西。 I tried reinstalling node-gyp and node-pre-gyp.我尝试重新安装 node-gyp 和 node-pre-gyp。 Didn't help at all.根本没有帮助。 :/ :/

First of all, don't use repl.it for hosting Discord bots.首先,不要使用 repl.it 来托管 Discord 机器人。
REPLs are for testing and not hosting . REPL 用于测试而不是托管
Second, your error clearly says you don't have python installed.其次,您的错误清楚地表明您没有安装 python。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM