启动调试会话时出现此错误。在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运行配置来启动您的应用程序 - 请参阅帮助说明和博客文章。我不明白您开始index.js
使用 Node.js时要完成的工作
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句