discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.44k stars 3.97k forks source link

node-gyp rebuild fails on my system! #1249

Closed ZheeWar closed 7 years ago

ZheeWar commented 7 years ago

i am trying to install/rebuild the node-opus again and i got the latest version of both npm and node js but it fails. it tells me to include: C:\Users\user_name\AppData\Roaming\npm-cache_logs\2017-03-02T21_0902 831Z-debug.log.

when i connect my bot to voicechat it says something like: couldn't find any opus engine

aemino commented 7 years ago

You are probably missing Python/another build dependency. Please either provide us with the error you're experiencing or just install opusscript (npm i opusscript), which works well on Windows.

ZheeWar commented 7 years ago

but i am using javscript do i need python for that? pyhton is another language. it says it's preffered to use node--opus cuz it performs significantly better then opusscript but does that not matter ?

here's the error i get if i connect the bot to voice:

Error: Couldn't find an Opus engine. at Object.exports.fetch (C:\Users\user_name\Desktop\Discord_Bot\bot\nod e_modules\discord.js\src\client\voice\opus\OpusEngineList.js:23:9) at AudioPlayer (C:\Users\user_name\Desktop\Discord_Bot\bot\node_modules \discord.js\src\client\voice\player\AudioPlayer.js:20:37) at VoiceConnection (C:\Users\user_name\Desktop\Discord_Bot\bot\node_mod ules\discord.js\src\client\voice\VoiceConnection.js:58:19) at PendingVoiceConnection.upgrade (C:\Users\user_name\Desktop\Discord_Bot\bot \node_modules\discord.js\src\client\voice\ClientVoiceManager.js:241:12) at PendingVoiceConnection.pass (C:\Users\user_name\Desktop\Discord_Bot\bot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:220:28) at PendingVoiceConnection.checkReady (C:\Users\user_name\Desktop\Discord_Bot\bot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:151:12)

at PendingVoiceConnection.setTokenAndEndpoint (C:\Users\user_name\Desktop\Discor

d_Bot\bot\node_modules\discord.js\src\client\voice\ClientVoiceManager.j s:192:10) at ClientVoiceManager.onVoiceServer (C:\Users\user_name\Desktop\Discord_Bot\bot \node_modules\discord.js\src\client\voice\ClientVoiceManager.js:36:74) at emitOne (events.js:96:13) at Client.emit (events.js:191:7)

And here's the error when i try installing it again when it's already installed/rebuild it:

gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT HON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_mo dules\npm\node_modules\node-gyp\lib\configure.js:454:19) gyp ERR! stack at PythonFinder. (C:\Program Files\nodejs\node_mod ules\npm\node_modules\node-gyp\lib\configure.js:480:16) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\grac eful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:114:15) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\user_name\Desktop\Discord_Bot\bot\node_modules\ref gyp ERR! node -v v7.7.1 gyp ERR! node-gyp -v v3.5.0 gyp ERR! not ok

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\ node_modules\npm\bin\npm-cli.js" "install" "discord.js" "node-opus" "--save" npm ERR! node v7.7.1 npm ERR! npm v4.3.0 npm ERR! code ELIFECYCLE npm ERR! errno 1

npm ERR! ref@1.3.4 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ref@1.3.4 install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the ref package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs ref npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls ref npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\user_name\AppData\Roaming\npm-cache_logs\2017-03-04T17_2113 292Z-debug.log

aemino commented 7 years ago

node-gyp relies on Python to build dependencies. As you can see in the NPM error logs, gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. You need to install Python 2.7 for node-gyp to function properly. While node-opus is preferable to opusscript because it is much faster, while you are on Windows rather than a UNIX-based system, you should probably use opusscript as it is much easier to install on Windows.

meew0 commented 7 years ago

Please use the official discord.js Discord server for questions; this issue tracker is only intended for bug reports and enhancement suggestions.

ZheeWar commented 7 years ago

okay,now i understand.

i installed python 2.7.13 and the python error is gone but something went wrong with MSBuild now so i get this error:

MSBUILD : error MSB1025: Ett internt fel uppstod vid körning av(a internal error happened under the running of) MSBuild. Microsoft.Build.BuildEngine.InvalidToolsetDefinitionException: MSBuildToolsPath har inte angetts för (have not been specified for)ToolsVersion 14.0 som definierats vid (that has defined at)HKEY_LOCAL_MACHINE\SO FTWARE\Microsoft\MSBuild\ToolsVersions\14.0, eller så utvärderas värdet som ange tts till den tomma strängen.(or the specified value to the empty string is investigated) vid Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, S tring[] targets, String toolsVersion, Dictionary`2 globalProperties, ILogger[] l oggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRe cords, Boolean needToValidateProject, String schemaFile, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean debugger, Boolean detaile dSummary) vid Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)

Ohanterat undantag: Microsoft.Build.BuildEngine.InvalidToolsetDefinitionExceptio n: MSBuildToolsPath har inte angetts för ToolsVersion 14.0 som definierats vid H KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0, eller så utvärd eras värdet som angetts till den tomma strängen. vid Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, S tring[] targets, String toolsVersion, Dictionary2 globalProperties, ILogger[] l oggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRe cords, Boolean needToValidateProject, String schemaFile, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean debugger, Boolean detaile dSummary) vid Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine) vid Microsoft.Build.CommandLine.MSBuildApp.Main() gyp ERR! build error gyp ERR! stack Error:C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ` failed with exit code: 3762504530 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\ npm\node_modules\node-gyp\lib\build.js:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:194:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces s.js:215:12)

i tried translating a little but it's difficult to do it right away. it's swedish. i am looking into how to fix it but don't know yet.

aemino commented 7 years ago

As already suggested to you, we have a Discord server for support. And also as I already suggested, if you don't want to deal with building node-opus, just use opusscript instead.

lukeacat commented 6 years ago

building node-opus is an struggle