我是react-native的新手,我尝试为自己的应用使用this repository。
我已经使用react-native init ppet
命令创建了初始项目。之后,我将存储库文件放在根目录中,但无法运行该程序。
package.json
{
"name": "ppet",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"@exponent/ex-navigation": "^2.9.1",
"exponent": "^14.0.0",
"react": "16.8.3",
"react-native": "0.59.9",
"react-native-drawer-menu": "^0.2.5"
},
"devDependencies": {
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"@babel/preset-react": "^7.0.0",
"@babel/runtime": "7.4.5",
"babel-jest": "24.8.0",
"babel-loader": "^7.1.5",
"babel-plugin-transform-class-properties": "^6.24.1",
"jest": "24.8.0",
"metro-react-native-babel-preset": "0.54.1",
"react-test-renderer": "16.8.3",
"webpack": "^4.34.0",
"webpack-cli": "^3.3.4"
},
"jest": {
"preset": "react-native"
}
}
.babelrc
{
"presets": ["babel-preset-exponent"],
"env": {
"development": {
"plugins": [["transform-react-jsx-source"],
["@babel/plugin-proposal-decorators", { "legacy": true }],
]
}
}
}
...但是我收到此错误消息:
error node_modules/exponent/src/index.js: Plugin/Preset files are not allowed to export objects, only functions. In /home/abbas/Desktop/REACT/ppet/node_modules/babel-preset-exponent/index.js
有人知道如何解决吗?