Macos React本机OSX CRNA编译µ;WebSocket在C++;11编译器

Macos React本机OSX CRNA编译µ;WebSocket在C++;11编译器,macos,c++11,react-native,expo,create-react-native-app,Macos,C++11,React Native,Expo,Create React Native App,从Expo中弹出后出现此问题(使用ExpoKit)。弹射前有一个工作环境npm运行ios将运行此问题,并反复出现: 来源:Worker(PID 6336)12:18:06:[错误]错误:getaddrinfo eNotFind lcalhost 12:18:06:at errnoException(dns.js:28:10) 12:18:06:at GetAddrInfoReqWrap.onlookup[作为完成] (dns.js:76:26) Expo XDE将完全不运行,并重复此消息。XCo

从Expo中弹出后出现此问题(使用ExpoKit)。弹射前有一个工作环境<代码>npm运行ios将运行此问题,并反复出现:

来源:Worker(PID 6336)12:18:06:[错误]错误:getaddrinfo eNotFind lcalhost 12:18:06:at errnoException(dns.js:28:10) 12:18:06:at GetAddrInfoReqWrap.onlookup[作为完成] (dns.js:76:26)

Expo XDE将完全不运行,并重复此消息。XCode包括C++11编译器

错误:编译µWebSockets失败,并且没有 预编译的二进制文件可用于您的系统。请安装一个 支持C++11编译器并重新安装模块“uws”

package.json app.json 如前所述,这可能是由环境造成的。那么,可以尝试以下几点:

  • 卸下节点模块,运行npm缓存清理,然后重新安装
  • 重新安装NodeJS
  • 使用CRNA创建新应用程序并进行比较

在我的例子中,弹出并使用Expo react本机分支(默认行为)会导致问题。更改回官方的react native npm包可以解决此问题。所以这应该是世博会方面的事情。

我不知道这是否对你有帮助,但它在docker内部解决了我的问题

在Docker文件中

//////////////////////////////////////////////////////////////////////////

来自节点:8.9-1

运行apk添加--更新\
libc6 compat

//////////////////////////////////////////////////////////////////////////

需要的
libc6紧凑型

因此,请尝试安装
libc6 compat

当我尝试启动一个来自Expo团队的应用程序时,我遇到了相同的问题(如下)。结果证明项目中的
uws
版本与我使用的节点版本不兼容节点v10.15.0

使用nvm将节点版本切换为
8.11.4
nvm使用8.11.4
解决了我的问题。(如果未安装8.11.4版本,请改用nvm安装8.11.4


检查你的@SyedZainAli你是对的,环境中有些东西坏了。然而,OSX没有明确的解决方案。我已经重新安装了RN和Expo。C++11编译器应该包含在Xcode中。我遇到的问题是,我试图安装的
uws
版本(通过react native)与Node 10.x不兼容。重新安装最新版本的Node 8修复了该问题。@对该问题的ephemer分析是正确和相关的。如果要保留节点10.x,可以将uws 10.148.0添加到devDe中
{
  "name": "OurApp",
  "version": "0.0.1",
  "private": true,
  "devDependencies": {
    "babel-eslint": "^8.0.3",
    "eslint": "^4.13.1",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-plugin-import": "^2.8.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-react": "^7.5.1",
    "jest-expo": "^23.0.0",
    "react-native-scripts": "1.8.1",
    "react-test-renderer": "16.0.0",
    "remotedev-rn-debugger": "^0.8.3"
  },
  "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "node node_modules/jest/bin/jest.js --watch",
    "postinstall": "remotedev-debugger --hostname lcalhost --port 5678 --injectserver",
    "eslint": "./node_modules/.bin/eslint"
  },
  "remotedev": {
    "hostname": "localhost",
    "port": 5678
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/vector-icons": "^6.2.1",
    "axios": "^0.17.1",
    "expo": "^23.0.0",
    "lodash": "^4.17.4",
    "prop-types": "^15.6.0",
    "react": "16.0.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-23.0.0.tar.gz",
    "react-native-elements": "^0.18.5",
    "react-native-maps": "^0.19.0",
    "react-navigation": "^1.0.0-beta.19",
    "react-navigation-redux": "^0.1.0",
    "react-redux": "^5.0.6",
    "redux": "^3.7.2",
    "redux-logger": "^3.0.6",
    "redux-promise": "^0.5.3",
    "redux-thunk": "^2.2.0",
    "remote-redux-devtools": "^0.5.12"
  }
}
{
  "expo": {
    "isDetached": false,
    "privacy": "unlisted",
    "sdkVersion": "23.0.0",
    "orientation": "portrait",
    "primaryColor": "#ffde00",
    "name": "OurApp",
    "description": "Desc",
    "icon": "./resources/icon.png",
    "version": "0.0.1",
    "slug": "our-app",
    "scheme": "ourapp",
    "ios": {
      "bundleIdentifier": "se.comp.expo",
      "config": {
        "googleMapsApiKey": "key"
      },
      "buildNumber": "1.0.0",
      "isRemoteJSEnabled": true,
      "supportsTablet": false,
      "associatedDomains": [
        "myDomain.com"
      ]
    },
    "android": {
      "package": "se.comp.expo",
      "versionCode": 1,
      "config": {
        "googleMaps": {
          "apiKey": "key"
        }
      },
      "permissions": [
        "CAMERA",
        "ACCESS_FINE_LOCATION"
      ]
    },
    "notification": {
      "icon": "./resources/icon_notify.png",
      "color": "#ffde00",
      "androidMode": "collapse",
      "androidCollapsedTitle": "#{unread_notifications} new"
    },
    "loading": {
      "icon": "./resources/icon.png",
      "backgroundColor": "#000000",
      "backgroundImage": "./resources/splash.png",
      "hideExponentText": true
    },
    "splash": {
      "backgroundColor": "#000000",
      "image": "./resources/splash.png",
      "resizeMode": "cover"
    },
    "androidStatusBar": {
      "barStyle": "dark-content",
      "backgroundColor": "#ffde00"
    },
    "facebookAppId": "id",
    "facebookDisplayName": "OurApp",
    "facebookScheme": "fbId",
    "androidShowExponentNotificationInShellApp": true
  }
}
$ expo start
Starting project at /Users/dugong/development/myApp
Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d to disable)
oteDev] Start server...
--------------------------------------------------------------------------------
[Busy] Launching SocketCluster
1555352786943 - Origin: Worker (PID 63541)
[Error] 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 (/Users/dugong/development/myApp/node_modules/socketcluster-server/node_modules/uws/uws.js:38:19)