TooTallNate / node-speaker

Output PCM audio data to the speakers
655 stars 147 forks source link

Install fails (node-gyp) under Win10 x64 #143

Open Zireael opened 4 years ago

Zireael commented 4 years ago

Looks like lots of warnings about 32 pointers vs 64 pointers

PS V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\app\audio> yarn add speaker yarn add v1.22.4 [1/4] Resolving packages... [2/4] Fetching packages... warning Pattern ["audio-context@latest"] is trying to unpack in the same destination "C:\Users\user\AppData\Local\Yarn\Cache\v6\npm-audio-context-1.0.3-aae5636691a8cdc15fc91059704cbc7c2fb7abf9-integrity\node_modules\audio-context" as pattern ["audio-context@^1.0.0","audio-context@^1.0.0","audio-context@^1.0.0","audio-context@^1.0.0"]. This could result in non-deterministic behavior, skipping. [3/4] Linking dependencies... [4/4] Building fresh packages... [1/2] ⠁ speaker warning Error running install script for optional dependency: "V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker: Command failed. Exit code: 1 Command: node-gyp rebuild Arguments: Directory: V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker Output: V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker>if not defined npm_config_node_gyp (node \"C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js\" rebuild ) else (node \"\" rebuild ) gyp info it worked if it ends with ok gyp info using node-gyp@5.1.0 gyp info using node@13.12.0 | win32 | x64 gyp info find Python using Python version 3.8.2 found at \"C:\Python38\python.exe\" gyp info find VS using VS2017 (15.9.28307.1064) found at: gyp info find VS \"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\" gyp info find VS run with --verbose for detailed information gyp info spawn C:\Python38\python.exe gyp info spawn args [ gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'msvs', gyp info spawn args '-I', gyp info spawn args 'V:\\Programming\\JavaScript\\Programming\\Projects\\azatom-keep-alive\\node_modules\\audio-speaker\\node_modules\\speaker\\build\\config.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I', gyp info spawn args 'C:\\Users\\user\\AppData\\Local\\node-gyp\\Cache\\13.12.0\\include\\node\\common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=C:\\Users\\user\\AppData\\Local\\node-gyp\\Cache\\13.12.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp', gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\13.12.0\\\\<(target_arch)\\\\node.lib', gyp info spawn args '-Dmodule_root_dir=V:\\Programming\\JavaScript\\Programming\\Projects\\azatom-keep-alive\\node_modules\\audio-speaker\\node_modules\\speaker', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'V:\\Programming\\JavaScript\\Programming\\Projects\\azatom-keep-alive\\node_modules\\audio-speaker\\node_modules\\speaker\\build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ gyp info spawn args 'build/binding.sln', gyp info spawn args '/clp:Verbosity=minimal', gyp info spawn args '/nologo', gyp info spawn args '/p:Configuration=Release;Platform=x64' gyp info spawn args ] Building the projects in this solution one at a time. To enable parallel build, please add the \"/m\" switch. win32.c win_delay_load_hook.cc output.vcxproj -> V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\build\Release\\liboutput.lib binding.cc win_delay_load_hook.cc v:\programming\javascript\programming\projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\src\binding.cc(30): error C2660: 'v8::Value::Int32Value': function does not take 0 arguments [V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\build\binding.vcxproj] c:\users\user\appdata\local\node-gyp\cache\13.12.0\include\node\v8.h(2778): note: see declaration of 'v8::Value::Int32Value' (compiling source file ..\src\binding.cc) v:\programming\javascript\programming\projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\src\binding.cc(31): error C2660: 'v8::Value::Int32Value': function does not take 0 arguments [V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\build\binding.vcxproj] c:\users\user\appdata\local\node-gyp\cache\13.12.0\include\node\v8.h(2778): note: see declaration of 'v8::Value::Int32Value' (compiling source file ..\src\binding.cc) v:\programming\javascript\programming\projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\src\binding.cc(32): error C2660: 'v8::Value::Int32Value': function does not take 0 arguments [V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\build\binding.vcxproj] c:\users\user\appdata\local\node-gyp\cache\13.12.0\include\node\v8.h(2778): note: see declaration of 'v8::Value::Int32Value' (compiling source file ..\src\binding.cc) v:\programming\javascript\programming\projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\src\binding.cc(51): error C2660: 'v8::Value::Int32Value': function does not take 0 arguments [V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\build\binding.vcxproj] c:\users\user\appdata\local\node-gyp\cache\13.12.0\include\node\v8.h(2778): note: see declaration of 'v8::Value::Int32Value' (compiling source file ..\src\binding.cc) v:\programming\javascript\programming\projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\src\binding.cc(80): warning C4996: 'Nan::Callback::Call': was declared deprecated [V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\build\binding.vcxproj] v:\programming\javascript\programming\projects\azatom-keep-alive\node_modules\nan\nan.h(1740): note: see declaration of 'Nan::Callback::Call' v:\programming\javascript\programming\projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\src\binding.cc(104): error C2065: 'Handle': undeclared identifier [V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\build\binding.vcxproj] v:\programming\javascript\programming\projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\src\binding.cc(104): error C2275: 'v8::Object': illegal use of this type as an expression [V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\build\binding.vcxproj]
c:\users\user\appdata\local\node-gyp\cache\13.12.0\include\node\v8.h(3541): note: see declaration of 'v8::Object' v:\programming\javascript\programming\projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\src\binding.cc(104): error C2065: 'target': undeclared identifier [V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\build\binding.vcxproj] v:\programming\javascript\programming\projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\src\binding.cc(104): error C2182: 'Initialize': illegal use of type 'void' [V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\build\binding.vcxproj] v:\programming\javascript\programming\projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker\src\binding.cc(104): error C2448: 'anonymous-namespace'::Initialize': function-style initializer appears to be a function definition [V:\\Programming\\JavaScript\\Programming\\Projects\\azatom-keep-alive\\node_modules\\audio-speaker\\node_modules\\speaker\\build\\binding.vcxproj] v:\\programming\\javascript\\programming\\projects\\azatom-keep-alive\\node_modules\\audio-speaker\\node_modules\\speaker\\src\\binding.cc(155): warning C4312: 'type cast': conversion from 'int' to 'node::addon_register_func' of greater size [V:\\Programming\\JavaScript\\Programming\\Projects\\azatom-keep-alive\\node_modules\\audio-speaker\\node_modules\\speaker\\build\\binding.vcxproj] 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: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) gyp ERR! System Windows_NT 10.0.18363 gyp ERR! command \"C:\\Program Files\\nodejs\\node.exe\" \"C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js\" \"rebuild\" gyp ERR! cwd V:\Programming\JavaScript\Programming\Projects\azatom-keep-alive\node_modules\audio-speaker\node_modules\speaker gyp ERR! node -v v13.12.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok" success Saved lockfile. success Saved 6 new dependencies. info Direct dependencies └─ speaker@0.5.1 info All dependencies ├─ buffer-alloc-unsafe@1.1.0 ├─ buffer-alloc@1.2.0 ├─ buffer-fill@1.0.0 ├─ debug@4.1.1 ├─ ms@2.1.2 └─ speaker@0.5.1 Done in 8.52s.

HelloDavideDeSimone commented 4 years ago

I have the same issue...

crutchcorn commented 3 years ago

I'm facing the same issue myself - I suspect it's a Node version issue. I am running on Node v12.16.1

Whobeu commented 3 years ago

I have windows-build-tools@5.2.2 installed and so far have had no issues installing on Windows 10 release 2004 in conjunction with Node.js 12.18.0+ and 14.15.0+ (I did not test earlier versions).

The only issue I have seen at the moment in testing is that node-speaker does not work with Node.js 15.0.0+ or 16.0.0 nightly. The installation appears to goes fine but calls to the node-speaker package return immediately without error. My code works fine if I use Node 14 or Node 12 but the same code returns immediately with Node 15 when it calls node-speaker. Most likely some changes in node-gyp that break compatibility and the newer Node.js 15 and/or 16 libraries are not being seen during build. Not really a problem at the moment since Node 16 is quite some time away in the future and 15 will not be around very long. Oddly, the node-gyp based lzma-native package does work with all version up to 16 so whatever is different in node-gyp would appear to be minor.