Codimd: Loading uws module fails

Created on 24 Mar 2018  路  7Comments  路  Source: hackmdio/codimd

Hello, My install of hackmd qas working flawlessly, but after a debian update, I got the following error when starting up
I've tried reinstalling uws, rebuilding it, but I still get the same error
I've got build-essential installed, so I don't think that I lack a C++11 compiler =\
Do someone have any idea ?

2018-03-24T15:37:04.352Z - error: uncaughtException: 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'. date=Sat Mar 24 2018 16:37:04 GMT+0100 (CET), pid=3567, uid=1000, gid=1000, cwd=/opt/hackmd, execPath=/usr/bin/node, version=v8.9.3, argv=[/usr/bin/node, /opt/hackmd/app.js], rss=90464256, heapTotal=68714496, heapUsed=42601912, external=832170, loadavg=[0.8544921875, 1.3974609375, 2.5380859375], uptime=1144796, trace=[column=19, file=/opt/hackmd/node_modules/uws/uws.js, function=native, line=38, method=null, native=false, column=3, file=/opt/hackmd/node_modules/uws/uws.js, function=null, line=42, method=null, native=false, column=30, file=module.js, function=Module._compile, line=635, method=_compile, native=false, column=10, file=module.js, function=Module._extensions..js, line=646, method=.js, native=false, column=32, file=module.js, function=Module.load, line=554, method=load, native=false, column=12, file=module.js, function=tryModuleLoad, line=497, method=null, native=false, column=3, file=module.js, function=Module._load, line=489, method=_load, native=false, column=17, file=module.js, function=Module.require, line=579, method=require, native=false, column=18, file=internal/module.js, function=require, line=11, method=null, native=false, column=21, file=/opt/hackmd/app.js, function=null, line=77, method=null, native=false, column=30, file=module.js, function=Module._compile, line=635, method=_compile, native=false, column=10, file=module.js, function=Module._extensions..js, line=646, method=.js, native=false, column=32, file=module.js, function=Module.load, line=554, method=load, native=false, column=12, file=module.js, function=tryModuleLoad, line=497, method=null, native=false, column=3, file=module.js, function=Module._load, line=489, method=_load, native=false, column=10, file=module.js, function=Module.runMain, line=676, method=runMain, native=false], stack=[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 (/opt/hackmd/node_modules/uws/uws.js:38:19),     at Object.<anonymous> (/opt/hackmd/node_modules/uws/uws.js:42:3),     at Module._compile (module.js:635:30),     at Object.Module._extensions..js (module.js:646:10),     at Module.load (module.js:554:32),     at tryModuleLoad (module.js:497:12),     at Function.Module._load (module.js:489:3),     at Module.require (module.js:579:17),     at require (internal/module.js:11:18),     at Object.<anonymous> (/opt/hackmd/app.js:77:21),     at Module._compile (module.js:635:30),     at Object.Module._extensions..js (module.js:646:10),     at Module.load (module.js:554:32),     at tryModuleLoad (module.js:497:12),     at Function.Module._load (module.js:489:3),     at Function.Module.runMain (module.js:676:10)]
bug upstream

Most helpful comment

Solved it by npm install ws and changing require("uws") to require("ws"), but still haven't found out the source of the problem

All 7 comments

Solved it by npm install ws and changing require("uws") to require("ws"), but still haven't found out the source of the problem

I'm using debian testing for what it's worth

Actually no matter what you use, it's not a problem HackMD can solve besides replacing the library.

But as the upstream seems to be "a bit special" when it comes to issues and help requests, you may just wait and stay with the work around for a while. And hope that either debian or the upstream fixes it.

Otherwise we recommend to use the docker image instead.

Edit: You could also try actually reinstall uws if you didn't already do

@konfiot You'll need gcc >= 4.8 to have C++ 11 support.
Replace uws with ws haven't been tested yet also not guaranteed for performance.

Check that you have node-gyp installed and try node-gyp rebuild in ./node_modules/uws

I ran into this issue today, this should fix it or show you the error.

uws fails to compile on debian 8 although all requirements listed in this post are there.
I also tried compiling uWS from source but that's just the lib, integration with nodeJS is another thing which is still a blank repo. Either way, point is that the uWS lib compiles fine on the same system.

The only workaround at this time is to use ws instead.

Another thing to consider is updating the package requirement to match the prefix/suffix the developer will set up once they actually post the module's source code. The developer is absolutely against publishing this package to npm.

This is now fixed in master by https://github.com/hackmdio/codimd/pull/958

Hint: We still use uws in 1.2.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  4Comments

ccoenen picture ccoenen  路  4Comments

neopostmodern picture neopostmodern  路  4Comments

LukasKalbertodt picture LukasKalbertodt  路  4Comments

mxmo0rhuhn picture mxmo0rhuhn  路  3Comments