Pat*_*ors 1 babeljs react-native expo
我是新手做出反应本土的,我正处于创建一个带有Expo的应用程序的早期阶段.我有一个工作的应用程序,直到安装redux.目前我从XDE收到以下错误:
Problem checking node_modules dependencies: Unexpected end of JSON input
Run Code Online (Sandbox Code Playgroud)
以及来自ios模拟器的以下内容:
Building JavaScript bundle: error
TransformError: ../app/main.js: Couldn't find preset "babel-preset-expo" relative to directory "../app/"
Run Code Online (Sandbox Code Playgroud)
我相信我的节点模块包含有效的JSON.应该注意的是,我使用的是当前版本的react-native而不是expo.
小智 7
当我尝试移动到世博会版本21.0.0时,我遇到了这个问题.
您应该尝试删除节点模块并使用yarn进行安装.
package.json
dependencies:{
"babel-preset-expo" : "^4.0.0",
"expo": "^21.0.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-21-0.2.tar.gz"
}
Run Code Online (Sandbox Code Playgroud)
我的.babelrc
{
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3040 次 |
| 最近记录: |