簡體   English   中英

WebStorm React Native無法啟動調試

[英]WebStorm React Native cant start debug

啟動調試會話時出現此錯誤。 JetBrains設置之前和之后,我從未使用過WebStorm

"C:\Program Files\JetBrains\WebStorm 2018.2.6\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" --inspect-brk=51768 L:\react\PropertyFinder\PropertyFinder\index.js
Debugger listening on ws://127.0.0.1:51768/b33603e7-c88c-4336-b4d1-6042b064fcb0
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
L:\react\PropertyFinder\PropertyFinder\index.js:1
(function (exports, require, module, __filename, __dirname) { import {AppRegistry} from 'react-native';
                                                                     ^

SyntaxError: Unexpected token {
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:656:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
Waiting for the debugger to disconnect...

Process finished with exit code -1073741510 (0xC000013A: interrupted by Ctrl+C)

這是Index.js

/** @format */

    import {AppRegistry} from 'react-native';
    import App from './App';
    import {name as appName} from './app.json';

    AppRegistry.registerComponent(appName, () => App);

任何想法? 看起來在index.js:1有問題,但是什么?

您應該使用React Native運行配置來啟動應用程序-請參閱幫助說明博客文章 我不明白用Node.js啟動index.js時要完成的工作

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM