为什么给我错误模块AppRegistry错误反应本机博览会

时间:2020-01-03 06:12:05

标签: javascript android react-native expo native-base

几天前,一切进展顺利,一切运行正常,我从无处避免了这个错误,我尝试更新所有模块,重新安装expo-cli,再次删除并安装模块,但是没有结果。

照片错误图片: here

控制台输出: here

输出控制台日志

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm@6.12.1
3 info using node@v12.13.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle @~prestart: @
6 info lifecycle @~start: @
7 verbose lifecycle @~start: unsafe-perm in lifecycle true
8 verbose lifecycle @~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Shair\Desktop\fastly-app\node_modules.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Shair\bin;C:\Python27;C:\Python27\Scripts;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files (x86)\Yarn\bin;C:\Users\Shair\AppData\Local\Microsoft\WindowsApps;C:\Users\Shair\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Shair\AppData\Roaming\npm;C:\Users\Shair\AppData\Local\Yarn\bin
9 verbose lifecycle @~start: CWD: C:\Users\Shair\Desktop\fastly-app
10 silly lifecycle @~start: Args: [ '/d /s /c', 'expo start' ]
11 silly lifecycle @~start: Returned: code: 1 signal: null
12 info lifecycle @~start: Failed to exec start script
13 verbose stack Error: @ start: expo start
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:210:5)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:210:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid @
15 verbose cwd C:\Users\Shair\Desktop\fastly-app
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v12.13.1
19 verbose npm v6.12.1
20 error code ELIFECYCLE
21 error errno 1
22 error @ start: expo start
22 error Exit status 1
23 error Failed at the @ start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

我的博览会诊断here

这也是我的app.json,package.json和App.js:

{
  "expo": {
    "name": "Fastly",
    "slug": "fastly-app",
    "privacy": "public",
    "sdkVersion": "36.0.0",
    "platforms": [
      "ios",
      "android",
      "web"
    ],
    "androidStatusBarColor": "#ffffff",
    "androidStatusBar": {
      "barStyle": "dark-content",
      "backgroundColor": "#ffffff"
    },
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "facebookAppId": "2353635448075929",
    "facebookDisplayName": "Fastly",
    "android": {
      "package": "com.shair.fastly"
    }
  }
}
{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "test": "jest --watchAll"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/samples": "~36.0.0",
    "@expo/vector-icons": "~10.0.0",
    "@react-navigation/web": "~1.0.0-alpha.9",
    "expo": "~36.0.0",
    "expo-asset": "~8.0.0",
    "expo-constants": "^8.0.0",
    "expo-facebook": "~8.0.0",
    "expo-font": "~8.0.0",
    "expo-permissions": "^8.0.0",
    "expo-web-browser": "~8.0.0",
    "firebase": "^7.6.1",
    "native-base": "^2.13.8",
    "react": "~16.9.0",
    "react-dom": "~16.9.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
    "react-native-gesture-handler": "~1.5.0",
    "react-native-paper": "^3.4.0",
    "react-native-reanimated": "~1.4.0",
    "react-native-screens": "2.0.0-alpha.12",
    "react-native-web": "~0.11.7",
    "react-navigation": "~4.0.10",
    "react-navigation-drawer": "^2.3.3",
    "react-navigation-material-bottom-tabs": "^2.1.5",
    "react-navigation-stack": "~1.10.3",
    "react-navigation-tabs": "~2.6.2",
    "react-redux": "^7.1.3",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0",
    "babel-preset-expo": "~8.0.0",
    "jest-expo": "~36.0.1"
  },
  "private": true
}

/** React bundle */
import React, { Component } from 'react'
import { View } from 'react-native'

import { createStore, combineReducers, applyMiddleware } from 'redux'

import ReduxThunk from 'redux-thunk'

import { Provider } from 'react-redux'

import { Root } from 'native-base'

import * as Font from 'expo-font'

/** Navigation */
import { createAppContainer, createSwitchNavigator } from 'react-navigation'
import { createStackNavigator } from 'react-navigation-stack'
import { createBottomTabNavigator } from 'react-navigation-tabs'

/** Icons: Ionicons */
import { Ionicons } from '@expo/vector-icons'

/** Screens: loading & accounts */
import LoadingScreen from './src/screens/LoadingScreen'
import LoginScreen from './src/screens/LoginScreen'
import RegisterScreen from './src/screens/RegisterScreen'

/** Screens tabs: Trending, Categories, Cart, Location, Profile */
import OffersScreen from './src/screens/OffersScreen'
import CategoriesScreen from './src/screens/CategoriesScreen'
import CartScreen from './src/screens/CartScreen'
import LocationScreen from './src/screens/LocationScreen'
import ProfileScreen from './src/screens/ProfileScreen'

/** Reducers */
import AuthReducers from './src/reducers/AuthReducers'

const AppContainer = createStackNavigator({
    default: createBottomTabNavigator({
      Offers: {
        screen: OffersScreen,
        navigationOptions: {
          tabBarIcon: ({ tintColor }) => <Ionicons name="ios-flash" size={24} color={tintColor} />
        }
      },
      Categories: {
        screen: CategoriesScreen,
        navigationOptions: {
          tabBarIcon: ({ tintColor }) => <Ionicons name="ios-pricetags" size={24} color={tintColor} />
        }
      },
      Cart: {
        screen: CartScreen,
        navigationOptions: {
          tabBarIcon: ({ tintColor }) => (
            <View style={{ backgroundColor: '#E9446A', borderRadius: 100, width: 50, height: 50, marginBottom: 5, alignItems: 'center', justifyContent: 'center', shadowColor: "#454D65", shadowOffset: { width: 0, height: 2, }, shadowOpacity: 0.25, shadowRadius: 3.84, elevation: 5, }}>
              <Ionicons name="ios-cart" size={30} color="#ffffff" />
            </View>
          )
        }
      },
      Location: {
        screen: LocationScreen,
        navigationOptions: {
          tabBarIcon: ({ tintColor }) => <Ionicons name="ios-pin" size={24} color={tintColor} />
        }
      },
      Profile: {
        screen: ProfileScreen,
        navigationOptions: {
          tabBarIcon: ({ tintColor }) => <Ionicons name="ios-person" size={24} color={tintColor} />
        }
      },
    },
    {
      defaultNavigationOptions: {
        tabBarOnPress: ({ navigation, defaultHandler }) => {
          navigation.state.key === 'Cart' ? navigation.navigate('cartModal') : defaultHandler()
        }
      },
      tabBarOptions: {
        activeTintColor: "#161F3D",
        inactiveTintColor: "#B8BBC4",
        showLabel: false,
      },
    },
  ),
  cartModal: {
    screen: CartScreen
  }
},
{
  mode: 'modal',
  headerMode: 'none',
  // initialRouteName: 'cartModal',
})

const AuthStack = createStackNavigator({
  Login: LoginScreen,
  Register: RegisterScreen,
})

const AppInit = createAppContainer(
  createSwitchNavigator({
    Loading: LoadingScreen,
    App: AppContainer,
    Auth: AuthStack,
  },
  {
    initialRouteName: 'Loading'
  })
)

/** Creando store: auth => para almacenar el login del usuario. */

const rootReducer = combineReducers({
  auth: AuthReducers,
})

const store = createStore(rootReducer, applyMiddleware(ReduxThunk))

/** */

export default class App extends Component {
  constructor(props) {
    super(props)
  }

  componentDidMount() {
    this.loadElements()
  }
  async loadElements() {
    await Font.loadAsync({
      Roboto: require('native-base/Fonts/Roboto.ttf'),
      Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'),
    })
  }

  render() {
    return (
      <Provider store={store}>
        <Root>
          <AppInit />
        </Root>
      </Provider>
    )
  }
}

0 个答案:

没有答案