Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system #17410

Closed
iammelvin opened this issue Jan 1, 2018 · 7 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@iammelvin
Copy link

Is this a bug report?

Yes

I cloned a react-native project from github then ran npm run eject after then when i tried to run the app using react-native run-android i am getting the below 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'.

Because of this the packager server exits and i couldn't connect to dev server from my physical device also one more issue i face is when i try to run adb reverse tcp:8081 tcp:8081 i am getting address already in use but i tried to kill adb using adb kill-server but still i get the same error.Need some help to get passed this as a new dev to react native.Thanks in advance !

@dnfield
Copy link

dnfield commented Jan 1, 2018

Do you have a C++11 compiler installed on your OS? Have you tried to reinstall the uws module?

This doesn't sound like a react-native issue, it sounds like an environmental issue/issue with the repo you cloned...

@iammelvin
Copy link
Author

iammelvin commented Jan 1, 2018

@dnfield Hey yes i did install c++ built tools 2015 and set env variable after a long time banging my head i found and fixed the issue just now.There was this binding.gyp file missing in node-gyp which i created manually and then it is now working will set this issue to closed.Thanks for responding.

@lfernando-silva
Copy link

I reinstalled C++ built tools 2015 and it worked on windows 10.

@brunolemos
Copy link
Contributor

I was able to fix this on a mac by doing:

cd node_modules/uws
npm install

@minhduchua
Copy link

minhduchua commented May 4, 2018

@iammelvin
We ran into the same problem on OSX High Sierra, react-native 0.48, XCode 9.3
What did you do in the node-gyp config which solved this issue?
That would certainly help.
Thx

@maciossek
Copy link

Dunno if this helps, but I had the same error using Node 10, switched to Node v9 and it works like a charm

@minhduchua
Copy link

minhduchua commented Jun 11, 2018

@maciossek
EDITED 2018-06-21 16.31 CEST
Thx, this helps indeed.
This is because uws v8.14.0, required in socketcluster-server by the metro packager, is not compatible with node 10.
In order to use node 10, you can require uws v10.148.0 in devDependencies you can force uws version to v10.148.0 by following: https://stackoverflow.com/a/48524488/5612908
Sorry, I should have come back and posted it earlier, I went so many places to solve this that I forgot half of them posting feedback...

ngot pushed a commit to eggjs/egg-socket.io that referenced this issue Sep 20, 2018
…,10 (#47)

1) 'uws', due to some personal issues
(See: socketio/socket.io#3319), the author
has destroyed it since 10.148.2. And after several times of trying. Only
10.148.0 can work very very properly in both Nodejs 8.x and 10.x. So use
this instead (Solution from
facebook/react-native#17410).

2) Remove "please find another reliable library instead" in the
corresponding docs because we HAVE TO use 'uws', which is in the
engine.io library, it will check whether you are referring this lib or
not. If not, an error will be thrown out to you.
See:
https://github.com/socketio/engine.io/blob/6a16ea119280a02029618544d44eb515f7f2d076/lib/server.js#L107.

3) Upgrade the whole project to the latest version (Node 8, 10).
@facebook facebook locked as resolved and limited conversation to collaborators Jan 1, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants