我正在用打字稿构建一个 react-native 应用程序,以便学习 react native。一旦我使用 expo start 运行应用程序并尝试在模拟器上运行,我就会收到此错误:
index.js: [BABEL] ......../index.js: Unknown option: .name. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options
其实我以前没有这个错误。我尝试安装react-native-dotenv包,同时也安装metro-react-native-babel-preset了它,我不确定是否已经安装。
我的 package.json 如下:
{
"name": "mobile-app",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@react-native-community/async-storage": "^1.12.0",
"@react-native-community/google-signin": "^4.0.3",
"@types/axios": "^0.14.0",
"axios": "^0.20.0",
"expo": "^38.0.10",
"react": "16.13.1",
"react-native": "0.62.2"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/runtime": "^7.8.4",
"@react-native-community/eslint-config": …Run Code Online (Sandbox Code Playgroud)