如何在Expo上使用VSCode调试React Native?

时间:2019-03-22 14:53:14

标签: react-native visual-studio-code expo

很抱歉,昨天我能使所有这些正常工作,但今天我无法让Expo附加到我的VS Code Debugger上,出现了各种问题。

目前,我没有服务器在运行。世博会已在我的模拟器中打开。我从VS Code的“ Expo in Expo”中点击了“运行”,并且收到此错误:

(node:16799) UnhandledPromiseRejectionWarning: Error: `fsevents` unavailable (this watcher can only be used on Darwin)
    at new FSEventsWatcher (/Users/TuzMacbookPro2017/Development/QMG/Learning/Tuz1App/node_modules/sane/src/fsevents_watcher.js:41:11)
    at createWatcher (/Users/TuzMacbookPro2017/Development/QMG/Learning/Tuz1App/node_modules/jest-haste-map/build/index.js:780:23)
    at Array.map (<anonymous>)
    at HasteMap._watch (/Users/TuzMacbookPro2017/Development/QMG/Learning/Tuz1App/node_modules/jest-haste-map/build/index.js:936:44)
    at _buildPromise._buildFileMap.then.then.hasteMap (/Users/TuzMacbookPro2017/Development/QMG/Learning/Tuz1App/node_modules/jest-haste-map/build/index.js:355:23)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)
(node:16799) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:16799) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[Error] Error: Could not start the packager.

让我们启动服务器,看看会发生什么... 服务器负载,一切都很好。我尚未从“地铁”屏幕中选择“运行”。

让我们再次尝试运行调试器,看看会发生什么...

Error: listen EADDRINUSE: address already in use :::8081
    at Server.setupListenHandle [as _listen2] (net.js:1256:14)
    at listenInCluster (net.js:1304:12)
    at Server.listen (net.js:1392:7)
    etc...

可以理解,npm运行在端口8081上。当我这样做时,它会打开一个chrome调试窗口。让我们点击“停止远程调试”,看看是否可以再次从VS Code运行调试器(可能由于端口仍在使用中而无法。-是的,同样的错误。)

好吧,现在我们已经在expo中禁用了远程调试,让我们停止服务器,也许尝试从VS Code重新启动?不。简单错误:

[Error] Error: Could not start the packager.

有帮助吗?我知道我应该写下我昨天采取的所有步骤!

0 个答案:

没有答案
相关问题