我刚刚在 Webstorm 中创建了一个React Native应用程序,但是当我运行它时,它显示了以下错误:
The development server returned response error code: 500
URL: http://10.0.3.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false
Body:
{"message":"TransformError: F:\\MyApps\\CatalogueApp\\index.android.js: Unexpected token ) (While processing preset: \"F:\\\\MyApps\\\\CatalogueApp\\\\node_modules\\\\babel-preset-react-native\\\\index.js\")","type":"TransformError","lineNumber":0,"description":"","errors":[{"description":"","lineNumber":0}]}
processBundleResult
BundleDownloader.java:170
access$100
BundleDownloader.java:39
onResponse
BundleDownloader.java:139
execute
RealCall.java:135
run
NamedRunnable.java:32
runWorker
ThreadPoolExecutor.java:1113
run
ThreadPoolExecutor.java:588
run
Thread.java:818
为什么?
下面是图片:
答案 0 :(得分:3)
这就是我在命令提示符中所做的事情它帮助了我。
npm uninstall babel-preset-react-native
npm install babel-preset-react-native@2.1.0
这意味着新版本的babel-preset-react-native
库,并且该新版本上有一个不受支持的尾随逗号。
答案 1 :(得分:0)