How to upgrade to React Native 0.57.0 version?
NickName:Morton Ask DateTime:2018-09-13T18:27:39

How to upgrade to React Native 0.57.0 version?

I create a project by CRNA and change to be a pure RN project.

When i type comman react-native-git-upgrade and run the project shows the error:

error: bundling failed: Error: ENOENT: no such file or directory, open '/Users/motogod19/MyWork/test_upgrade/node_modules/react-native/node_modules/create-react-class/index.js'

Before upgrade enviroment:

package.json:

{
  "name": "test_upgrade",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "babel-preset-react-native-stage-0": "^1.0.1",
    "jest": "^23.6.0",
    "jest-react-native": "^18.0.0",
    "react-test-renderer": "16.3.1"
  },
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "test": "jest"
  },
  "jest": {
    "preset": "react-native"
  },
  "dependencies": {
    "react": "16.3.1",
    "react-native": "~0.55.2"
  }
}

.babelrc:

{
  "presets": [
    "babel-preset-react-native-stage-0/decorator-support"
  ],
  "env": {
    "development": {
      "plugins": [
        "transform-react-jsx-source"
      ]
    }
  }
}

After upgrade:

package.json:

{
  "name": "test_upgrade",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {

    "metro-react-native-babel-preset": "0.45.2",
    "jest": "^23.6.0",
    "jest-react-native": "^18.0.0",
    "react-test-renderer": "16.3.1"
  },
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "test": "jest"
  },
  "jest": {
    "preset": "react-native"
  },
  "dependencies": {
    "react": "16.5.0",
    "react-native": "~0.57.0"
  }
}

.babelrc:

{
  "presets": [
    "module:metro-react-native-babel-preset"
  ],
  "env": {
    "development": {
      "plugins": [
        "transform-react-jsx-source"
      ]
    }
  }
}

I have no idea how to fix it. Any help would be appreciated, thanks in advance.

Step 1: If type npm install create-react-class and run it shows error:

error: bundling failed: Error: Couldn't find preset "module:metro-react-native-babel-preset" relative to directory "/Users/motogod19/MyWork/test_up"
    at /Users/motogod19/MyWork/test_up/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19

The option-manager.js line 293 is:

if (typeof val === "string") {
      presetLoc = (0, _resolvePreset2.default)(val, dirname);

      if (!presetLoc) {
        throw new Error("Couldn't find preset " + (0, _stringify2.default)(val) + " relative to directory " + (0, _stringify2.default)(dirname));
      }

      val = require(presetLoc);
    }

Still can't figure it out, thanks in advance.

Copyright Notice:Content Author:「Morton」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52311783/how-to-upgrade-to-react-native-0-57-0-version

Answers
codehesh 2018-09-13T11:04:50

Run react-native upgrade and run the project.\n\nIf it's not working , install that module manually.\n\nnpm install create-react-class\n\n\nThen somewhere in your code, add:\n\nrequire('create-react-class');\n\n\nLet me know if you have any issues.",


More about “How to upgrade to React Native 0.57.0 version?” related questions

How to upgrade to React Native 0.57.0 version?

I create a project by CRNA and change to be a pure RN project. When i type comman react-native-git-upgrade and run the project shows the error: error: bundling failed: Error: ENOENT: no such file...

Show Detail

How to upgrade to latest version of React Native?

How do you upgrade to the latest version of react? I've tried all the following but I'm still stuck at v0.58.6. react-native upgrade npm install -g react-native-git-upgrade react-native-git-upgra...

Show Detail

How to Upgrade React Native Version 0.66.3 to 0.70.6?

Currently, my project running on the 0.66.3 version I need to upgrade to react native version 0.70.6. So I have used to following command npx react-native upgrade After running this command showing

Show Detail

How to Upgrade React Native Version 0.66.3 to 0.70.6?

Currently, my project running on the 0.66.3 version I need to upgrade to react native version 0.70.6. So I have used to following command npx react-native upgrade After running this command showing

Show Detail

How to upgrade project version of React native

I have an application which runs on react-native 0.59.5 I want to upgrade to the latest version which 0.64.0. Best way to upgrade the project

Show Detail

How can I upgrade the react-native version?

I tried to update my react-native version to latest one. i.e react-native 0.60.3 I got the following error with these two methods. C:\Users\Kamlesh\Desktop\Final Project>react-native upgrade i...

Show Detail

How to upgrade react-native to latest version

I am trying to upgrade to the latest version of react-native(react-native-0.26.2) so i can use react-native-flux-router. I am getting this error: The chrome console only shows default error mess...

Show Detail

how to upgrade react-native-cli?

Check current react native CLI version react-native -v react-native-cli: 1.0.0 react-native: 0.61.5 I use the following commands to upgrade global react-native-cli verison npm uninstall -g react-

Show Detail

How can I upgrade react-native gradle version

I need help. I can't upgrade gradle version of my react-native project. I try a lot of things, downloaded last version of Android Studio & SDK Tools etc. I changed this file \android\gradle\w...

Show Detail

react native how to upgrade project version 0.61.0to latest version

React native 61 to 64 + current version 0.61.0 upgrade to latest version best way to upgrade project

Show Detail