Javascript Heroku应用程序崩溃-从'导入{AppRegistry};反应本机';;-SyntaxError:意外的令牌导入

Javascript Heroku应用程序崩溃-从'导入{AppRegistry};反应本机';;-SyntaxError:意外的令牌导入,javascript,react-native,heroku,babeljs,Javascript,React Native,Heroku,Babeljs,我正在尝试构建heroku应用程序,但当我运行该应用程序时,控制台中显示以下错误消息: import {AppRegistry} from 'react-native'; ^^^^^^ SyntaxError: Unexpected token import 从我在网上看到的情况来看,这可能是一个通俗易懂的问题?不完全确定,但如有任何帮助,将不胜感激 这是我的index.js文件: import {AppRegistry} from 'react-native'; import App fro

我正在尝试构建heroku应用程序,但当我运行该应用程序时,控制台中显示以下错误消息:

import {AppRegistry} from 'react-native';
^^^^^^
SyntaxError: Unexpected token import
从我在网上看到的情况来看,这可能是一个通俗易懂的问题?不完全确定,但如有任何帮助,将不胜感激

这是我的index.js文件:

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

AppRegistry.registerComponent(appName, () => App);
这是我的package.json文件:

{
"name": "rnTutorial",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.8.6",
"react-native": "0.60.3",
"prop-types": "^15.7.2",
"react-native-router-flux": "^4.0.6",
"react-redux": "^7.1.0",
"redux": "^4.0.1",
"redux-form": "^8.2.4",
"redux-persist": "^5.6.12",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@babel/core": "^7.5.4",
"@babel/runtime": "^7.5.4",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.8.0",
"eslint": "^6.0.1",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "^0.55.0",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}

您是否在jest测试文件中使用
import
?@Taym我不确定。我在哪里可以找到这个?检查u测试uu文件夹中的文件,您能共享项目文件结构和更多代码以便我们提供帮助吗?