美文网首页
RN - 新创建的工程报错 Module @babel/runt

RN - 新创建的工程报错 Module @babel/runt

作者: iOS_杨平 | 来源:发表于2018-10-02 15:04 被阅读0次

    https://github.com/facebook/react-native/issues/21310

    Environment

    React Native Environment Info:

    System:

    OS: macOS High Sierra 10.13.6

    CPU: x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz

    Memory: 408.65 MB / 8.00 GB

    Shell: 3.2.57 - /bin/bash

    Binaries:

    Node: 8.12.0 - /usr/local/bin/node

    Yarn: 1.3.2 - /usr/local/bin/yarn

    npm: 6.4.1 - /usr/local/bin/npm

    Watchman: 4.9.0 - /usr/local/bin/watchman

    SDKs:

    iOS SDK:

    Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0

    Android SDK:

    Build Tools: 23.0.1, 23.0.2, 23.0.3, 25.0.0, 25.0.2, 25.0.3, 26.0.2, 26.0.3, 27.0.1, 27.0.2

    API Levels: 23, 24, 25, 26, 27

    IDEs:

    Android Studio: 3.0 AI-171.4443003

    Xcode: 10.0/10A255 - /usr/bin/xcodebuild

    npmPackages:

    react: 16.5.0 => 16.5.0

    react-native: 0.57.1 => 0.57.1

    npmGlobalPackages:

    create-react-native-app: 1.0.0

    react-native-cli: 2.0.1

    react-native-git-upgrade: 0.2.7

    Description

    When starting a new project with react-native init then run iOS, I'm getting the error :

    Module @babel/runtime/helpers/interopRequireDefault does not exist in the Haste module map

    Reproducible Demo

    react-native init myapp

    // FIX CFBundleIdentifier issue with react-native upgrade

    react-native run-ios

    Get the error.

    FIX

    The issue can be fix by doing:

    npm add @babel/runtime

    npm install

    But we shouldn't have to do all this stuff !

    温馨提示:报错的时候可以先去这个网址搜索Issues,大部分可以找到解决方案

    相关文章

      网友评论

          本文标题:RN - 新创建的工程报错 Module @babel/runt

          本文链接:https://www.haomeiwen.com/subject/rpfaoftx.html