Setup examples
First I tried building example to understand how to use WebRTC.node-webrtc-examples - GitHub
So I cloned the repository and did "npm install".
And got error.
PS C:\Users\example\Documents\workspace\node-webrtc-examples> npm install > canvas@2.6.1 install C:\Users\example\Documents\workspace\node-webrtc-examples\node_modules\canvas > node-pre-gyp install --fallback-to-build node-pre-gyp WARN Using needle for node-pre-gyp https download node-pre-gyp WARN Pre-built binaries not installable for canvas@2.6.1 and node@13.13.0 (node-v79 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error Remote end closed socket abruptly. node-pre-gyp WARN Pre-built binaries not installable for canvas@2.6.1 and node@13.13.0 (node-v79 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error ENOENT: Cannot cd into 'C:\Users\example\Documents\workspace\node-webrtc-examples\node_modules\canvas\build\Release' Warning: Missing input files: C:\GTK\bin\libcairo-2.dll C:\GTK\bin\libpango-1.0-0.dll C:\GTK\bin\libglib-2.0-0.dll C:\GTK\bin\libfreetype-6.dll C:\GTK\bin\libgmodule-2.0-0.dll C:\GTK\bin\libpangocairo-1.0-0.dll C:\GTK\bin\libgthread-2.0-0.dll C:\GTK\bin\libgobject-2.0-0.dll C:\GTK\bin\zlib1.dll C:\GTK\bin\libpangowin32-1.0-0.dll C:\GTK\bin\libfontconfig-1.dll C:\GTK\bin\libpng14-14.dll C:\GTK\bin\libpangoft2-1.0-0.dll C:\GTK\bin\libintl-8.dll C:\GTK\bin\libexpat-1.dll Warning: Missing input files: C:\GTK\bin\libexpat-1.dll C:\GTK\bin\libfontconfig-1.dll C:\GTK\bin\libpng14-14.dll C:\GTK\bin\libgmodule-2.0-0.dll C:\GTK\bin\libfreetype-6.dll C:\GTK\bin\libintl-8.dll C:\GTK\bin\libpango-1.0-0.dll C:\GTK\bin\libglib-2.0-0.dll C:\GTK\bin\libpangowin32-1.0-0.dll C:\GTK\bin\zlib1.dll C:\GTK\bin\libgobject-2.0-0.dll C:\GTK\bin\libpangocairo-1.0-0.dll C:\GTK\bin\libgthread-2.0-0.dll C:\GTK\bin\libpangoft2-1.0-0.dll C:\GTK\bin\libcairo-2.dll Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch. Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch. C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(333, 5): error MSB3491: Could not write lines to file "Release\obj\canvas\canvas.tlog\canvas.lastbuildstate". The process ca nnot access the file 'C:\Users\example\Documents\workspace\node-webrtc-examples\node_modules\canvas\build\Release\obj\can vas\canvas.tlog\canvas.lastbuildstate' because it is being used by another process. [C:\Users\example\Documents\workspace \node-webrtc-examples\node_modules\canvas\build\canvas.vcxproj] gyp ERR! build error gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\example\AppData\Local\Volta\tools\image\node\13.13.0\6.14.4\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.18362 gyp ERR! command ...
I needed installing "windows-build-tools".
node.js - node-gyp installation failures on Windows - Stack Overflow
So I did "npm -g install windows-build-tools".
...And failed (2nd).
Can't do "npm -g install"
I had two problems.One of the problem was caused by I had done by normal user.
Because Python, Build-tools of Visual Studio 2017 were also installed on installing "windows-build-tools", I had had to do by super user.
Another one was caused by using Volta.
Volta hadn't allowed "npm -g install".
PS C:\Users\example\Documents\workspace\node-webrtc-examples> npm install -g windows-build-tools Volta error: Global package installs are not supported. Use `volta install windows-build-tools` to add a package to your toolchain (see `volta help install` for more info).
So I did "volta install windows-build-tools".
PS C:\Users\example\Documents\workspace\node-webrtc-examples> volta install windows-build-tools error: Package has no executables to install. Please verify the requested package name.
...What?
Global installs done right | Volta
Volta not allowing global installs · Issue #555 · volta-cli/volta · GitHub
Should I install Node.js directly for "npm -g install"?
Play example
OK. I finally succeeded "npm install".And no errors are occurred by "npm test".
So I do "npm start".
......and failed (3rd).
PS C:\Users\example\Documents\workspace\node-webrtc-examples> npm start > node-webrtc-examples@0.1.0 start C:\Users\example\Documents\workspace\node-webrtc-examples > node index.js internal/modules/cjs/loader.js:955 throw err; ^ Error: Cannot find module '../build/Release/wrtc.node' Require stack: - C:\Users\example\Documents\workspace\node-webrtc-examples\node_modules\wrtc\lib\binding.js - C:\Users\example\Documents\workspace\node-webrtc-examples\node_modules\wrtc\lib\index.js - C:\Users\example\Documents\workspace\node-webrtc-examples\lib\server\connections\webrtcconnection.js - C:\Users\example\Documents\workspace\node-webrtc-examples\lib\server\connections\webrtcconnectionmanager.js - C:\Users\example\Documents\workspace\node-webrtc-examples\index.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:952:15) at Function.Module._load (internal/modules/cjs/loader.js:835:27) at Module.require (internal/modules/cjs/loader.js:1012:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (C:\Users\example\Documents\workspace\node-webrtc-examples\node_modules\wrtc\lib\binding.js:6:20) at Module._compile (internal/modules/cjs/loader.js:1123:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10) at Module.load (internal/modules/cjs/loader.js:972:32) at Function.Module._load (internal/modules/cjs/loader.js:872:14) at Module.require (internal/modules/cjs/loader.js:1012:19) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\\Users\\example\\Documents\\workspace\\node-webrtc-examples\\node_modules\\wrtc\\lib\\binding.js', 'C:\\Users\\example\\Documents\\workspace\\node-webrtc-examples\\node_modules\\wrtc\\lib\\index.js', 'C:\\Users\\example\\Documents\\workspace\\node-webrtc-examples\\lib\\server\\connections\\webrtcconnection.js', 'C:\\Users\\example\\Documents\\workspace\\node-webrtc-examples\\lib\\server\\connections\\webrtcconnectionmanager.js', 'C:\\Users\\example\\Documents\\workspace\\node-webrtc-examples\\index.js' ] } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-webrtc-examples@0.1.0 start: `node index.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-webrtc-examples@0.1.0 start 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\example\AppData\Roaming\npm-cache\_logs\2020-04-25T11_08_10_012Z-debug.log
I thought this example also supported ver.13 as same as node-webrtc.
But actually it supported only ver.12 or earlier versions.
The error was same as this issue.
Error: Cannot find module '../build/Release/wrtc.node' · Issue #3 · geckosio/phaser3-multiplayer-game-example · GitHub
So I installed ver.12 and pinned it.
After re-installing node_modules, I could "npm start".
コメント
コメントを投稿