SocketCluster / scc-broker

Server for the SC cluster - For horizontal scalability.
MIT License
11 stars 10 forks source link

NodeJS version 10: Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system #14

Open nguyenhaian opened 5 years ago

nguyenhaian commented 5 years ago

I am using node v10.15.1. When I run broker instance by:

SCC_STATE_SERVER_HOST='127.0.0.1' SCC_BROKER_SERVER_PORT='8888' node server

I got error as:

Origin: Worker (PID 51413)
   [Error] WSEngineInitError: Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system. Please install a supported C++11 compiler and reinstall the module 'sc-uws'
    at native (/Users/annguyen/workspace/sccp/scc-broker/node_modules/sc-uws/uws.js:40:21)
    at Object.<anonymous> (/Users/annguyen/workspace/sccp/scc-broker/node_modules/sc-uws/uws.js:46:3)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at new SCServer (/Users/annguyen/workspace/sccp/scc-broker/node_modules/socketcluster-server/scserver.js:106:54)
Gromph commented 5 years ago

I ran into this same problem running on Windows 10 with node 10.15.3 I found this related issue in sc-uws: https://github.com/SocketCluster/sc-uws/issues/2 It mentioned setting wsEngine to "ws". Setting the environment var SOCKETCLUSTER_WS_ENGINE to ws worked for me to get scc-broker running