How to upgrade core-js@3 in react-native cli?

谁都会走 提交于 2020-02-03 04:29:12

问题


I am trying to create new project with react-native cli, but when I create a new project I am receiving the following error message:

react-native > create-react-class > fbjs > core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.

Listed below is the contents of my package.json file:

{
      "name": "EmojiDictRN",
      "version": "0.0.1",
      "private": true,
      "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
      },
      "dependencies": {
        "react": "16.8.3",
        "react-native": "0.59.8"
      },
      "devDependencies": {
        "@babel/core": "^7.4.5",
        "@babel/runtime": "^7.4.5",
        "babel-jest": "^24.8.0",
        "jest": "^24.8.0",
        "metro-react-native-babel-preset": "^0.54.1",
        "react-test-renderer": "16.8.3"
      },
      "jest": {
        "preset": "react-native"
      }
    }

To see the full output from my terminal please click here. Any ideas on how to resolve this warning message?

Any help would be greatly appreciated!


回答1:


Download and save the version of the core-js module which is requested within your warning message:

npm install --save core-js@^3

This will update the core-js dependency for your react-native project to use version ^3.x.x which is still being actively maintained.

Hopefully that helps!



来源:https://stackoverflow.com/questions/56419415/how-to-upgrade-core-js3-in-react-native-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!