How to update core-js to core-js@3 dependency?

后端 未结 6 654

While I was trying to install and setup react native, the precaution observed about the core-js version as update your core-js@... to core-js@3 But don\'t know how to update

相关标签:
6条回答
  • 2020-12-24 11:11

    With this

    npm install --save core-js@^3
    

    you now get the error

    "core-js@<3 is no longer maintained and not recommended for usage due to the number of
    issues. Please, upgrade your dependencies to the actual version of core-js@3"
    

    so you might want to instead try

    npm install --save core-js@3
    

    if you're reading this post June 9 2020.

    0 讨论(0)
  • 2020-12-24 11:12

    For npm

     npm install --save core-js@^3
    

    for yarn

    yarn add core-js@^3
    
    0 讨论(0)
  • 2020-12-24 11:20

    For ng9 upgraders:

    npm i -g core-js@^3

    ..then:

    npm cache clean -f

    ..followed by:

    npm i

    0 讨论(0)
  • 2020-12-24 11:21

    How about reinstalling the node module? Go to the root directory of the project and remove the current node modules and install again.

    These are the commands : rm -rf node_modules npm install

    OR

    npm uninstall -g react-native-cli and

    npm install -g react-native-cli
    
    0 讨论(0)
  • 2020-12-24 11:26

    Install

    npm i core-js
    

    Modular standard library for JavaScript. Includes polyfills for ECMAScript up to 2019: promises, symbols, collections, iterators, typed arrays, many other features, ECMAScript proposals, some cross-platform WHATWG / W3C features and proposals like URL. You can load only required features or use it without global namespace pollution.

    Read: https://www.npmjs.com/package/core-js

    0 讨论(0)
  • 2020-12-24 11:27

    You update core-js with the following command:

    npm install --save core-js@^3
    

    If you read the React Docs you will find that the command is derived from when you need to upgrade React itself.

    0 讨论(0)
提交回复
热议问题