本文介绍了如何将core-js更新为core-js@3依赖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

当我尝试本机安装和设置REACT时,有关core-js版本的注意事项是更新您的core-js@...至core-js@3,但不知道如何更新我的core-js。

$ sudo react-native init AwesomeProject121
Password:
This will walk you through creating a new React Native project in /Users/amarnr1989/AwesomeProject121
Using yarn v1.13.0
Installing react-native...
yarn add v1.13.0
info No lockfile found.
[1/4] 🔍  Resolving packages...
warning react-native > create-react-class > fbjs > [email protected]: core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
[2/4] 🚚  Fetching packages...
[----------------------------------------------------------------------------------------------------------------------------------------------------------] 0/601internal/modules/cjs/loader.js:584
    throw err;
    ^

Error: Cannot find module '/Users/amarnr1989/AwesomeProject121/node_modules/react-native/package.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at checkNodeVersion (/usr/local/lib/node_modules/react-native-cli/index.js:306:21)
    at run (/usr/local/lib/node_modules/react-native-cli/index.js:300:3)
    at createProject (/usr/local/lib/node_modules/react-native-cli/index.js:249:3)
    at init (/usr/local/lib/node_modules/react-native-cli/index.js:200:5)
    at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:153:7)
    at Module._compile (internal/modules/cjs/loader.js:701:30)

请提出建议

推荐答案

您可以使用以下命令更新core-js:

npm install --save core-js@^3

如果您阅读React Docs,您会发现该命令派生自您需要升级反应本身的时间。

这篇关于如何将core-js更新为core-js@3依赖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 12:07