Streaming service won't start on Ubuntu 18.04

Hello there.

I just migrated an instance from mastohost to my own server.
Everything is OK, except the streaming service won’t start…

When i try a NODE_ENV=production PORT=4000 /usr/bin/npm run start, I got this error :

            throw new Error('Compilation of µWebSockets has failed and there is no pre-compiled binary ' +

Error: 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 'uws'.
    at native (/home/mastodon/cnbt/node_modules/uws/uws.js:38:19)
    at Object.<anonymous> (/home/mastodon/cnbt/node_modules/uws/uws.js:42:3)
    at Module._compile (internal/modules/cjs/loader.js:678:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/mastodon/cnbt/streaming/index.js:10:19)

I’ve read this topic and tried to rebuild uws, but this doesn’t help.

I’ve also read this one and upgraded nodejs to v10.1.0 but it doesn’t help neither.
And I don’t know how to print the binary it’s looking for. :confused:

I’m running Ubuntu 18.04, node 10.1.0 and npm 5.6.0.

Does someone have a clue ?

So I’m not alone with this one :thinking:

I solved it by installing gcc-8 and running node-gyp rebuild inside the node_modules/uws/ directory

1 Like

Yes that is the solution. In general I would advice against upgrade of node unless you know all binary modules are working.

1 Like

It worked ! Thanks a lot !

I had to downgrade nodejs to v8.10.0 (stock on Ubuntu 18.04), and it worked.

Thanks again :slight_smile:

1 Like

@saper This error was happening before upgrading to node10, and still happens after updating mastodon.
I have to node-gyp rebuild after updating.

1 Like