我正在尝试通过执行来启动一个新的反应本机博览会应用程序
npx expo start
但它会引发以下错误
FetchError: request to https://api.expo.dev/v2/sdks/51.0.0/native-modules failed, reason: unable to get local issuer certificate
FetchError: request to https://api.expo.dev/v2/sdks/51.0.0/native-modules failed, reason: unable to get local issuer certificate
at ClientRequest.<anonymous> (C:\app\expo-app\node_modules\node-fetch\lib\index.js:1501:11)
at ClientRequest.emit (node:events:519:28)
at TLSSocket.socketErrorListener (node:_http_client:500:9)
at TLSSocket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
更新
执行以下命令时我也遇到同样的错误
npx expo install react-dom react-native-web @expo/metro-runtime
这个问题可能的解决办法是什么?感谢您的建议。
我面临着同样的问题,不知何故它得到了与代理或网络相关的东西。 我使用的是Linux Ubuntu,通过修改
/etc/hosts
解决了这个问题。
我只是像这样定义请求的域。
127.0.0.1 localhost
127.0.1.1 阿里夫库尔迪 104.18.4.104 api.expo.dev