1、问题描述:

在npm start启动react项目的时候,会出现Cannot find module '@babel/runtime/core-js/object/keys'的报错:

打开:项目根目录\node_modules\@babel\runtime,发现runtime文件夹下没有core-js文件夹。安装了babel-runtime,但是@babel\runtime下没有该文件夹,说明runtime包有问题,缺少依赖。

虽然此问题不影响项目正常启动和使用,但是问题还是需要解决,结合网上案例和实践操作,发现了解决方法:

2、解决方法如下:

(1)直接命令窗口执行以下命令安装依赖即可:

npm install @babel/runtime@7.0.0-beta.46 --save-dev

注:安装指定版本的依赖到开发/生产环境的方式如下(如果安装了淘宝镜像,用cnpm代替npm安装更快):

npm install xxx --save
npm install xxx --save-dev

(2)在项目根目录的 package.json文件中的"devDependencies"下加上"@babel/runtime": "7.0.0-beta.46",保存后打开命令行运行 npm i,

即安装指定版本7.0.0-beta.46的依赖,如下图:

安装完以后,重新start发现报错没有了,此时查看\node_modules\@babel\runtime,发现多了core-js文件夹,这就是先前所缺少的依赖包,安装了@babel/runtime后解决了依赖包缺失问题。

关于package.json依赖版本的说明,可参考:https://blog.csdn.net/weixin_40817115/article/details/86611179

关于devDependencies等依赖包分类,可参考:https://www.cnblogs.com/dfyg-xiaoxiao/p/10004392.html

Error: Cannot find module '@babel/runtime/core-js/object/keys'(npm start报错)的更多相关文章

  1. webpack.config.js配置遇到Error: Cannot find module '@babel/core'&&Cannot find module '@babel/plugin-transform-react-jsx' 问题

    下文是网上找到的方法,是因为版本冲突的原因,参照后安装7版本解决 cnpm install -D babel-loader@ babel-core babel-preset-env 一. 问题描述 在 ...

  2. webpack.config.js配置遇到Error: Cannot find module '@babel/core'问题

    在webpack配置,将ES6转成ES5的时候,,出现Error: Cannot find module '@babel/core'错误最初以为是babel-core没有安装上.重装了好几遍babel ...

  3. Module not found: Error: Can't resolve '@babel/runtime/helpers/classCallCheck' and Module not found: Error: Can't resolve '@babel/runtime/helpers/defineProperty'

    These two mistakes are really just one mistake, This is because the following file @babel/runtime ca ...

  4. vue报错-Error: Cannot find module '@babel/core'

    vue之webpack实战的时候遇到报错,Error: Cannot find module '@babel/core' 这报错,我百度了很久,后来发现报错里面有提示,发现是我的 babel-load ...

  5. Error: Cannot find module '../lib/utils/unsupported.js'

    报错: nodejs : Error: Cannot find module '../lib/utils/unsupported.js' 解决办法(linux): 去node目录下:/node***/ ...

  6. babel把ES6转化为ES5的时候报错

    Module not found: Error: Can't resolve '@babel/runtime/helpers/asyncToGenerator' in 'e:\Node.js\Node ...

  7. npm install 报错 error Unexpected end of JSON input while parsing near '...sShrinkwrap":false,"d' 解决办法

    npm install 报错 : error Unexpected end of JSON input while parsing near '...sShrinkwrap":false,& ...

  8. npm -v 报错:Error: EPERM: operation not permitted, mkdir 'C:\soft\nodejs'

    npm -v 报错:Error: EPERM: operation not permitted, mkdir 'C:\soft\nodejs' 起因:原本安装node在C盘soft文件夹下,按node ...

  9. Error: Cannot find module '@babel/core'

    报错如下 产生原因 babel-loader和babel-core版本不对应所产生的, babel-loader 8.x对应babel-core 7.x babel-loader 7.x对应babel ...

随机推荐

  1. less循环写css工具类

    //margin-right=================.mr(100); .mr(@n, @i: 1) when (@i =< @n) { .mr-@{i} { margin-right ...

  2. 至Linux-2.6.32编译内核ipset-6.23坎坷的经历

    新的版本号ipset 上周,一名医生在儿童医院等待一段差距叫做数量.接受NetfilterPush信息的邮件列表,列表ipset最新6.23版本号的新功能,非常喜欢我现在需要的是,特别是timeout ...

  3. Windows SublimeText内使用NDK编译Android so(不用cygwin)

    測试环境: sublime text version 2.0.2, build 2221 和 sublime text stable channel, build 3065 (version3) Wi ...

  4. [C++] 反编译器

    各种开源的decompiler都不太好用,眼下最好的反编译器是IDA pro. 尽管是收费的,只是破解版非常好找. 我试过5.5版本号的,还不错. 我把windows notepad进行了反编译,多少 ...

  5. phpStudy2018安装完成之后,Apache刚启动就关闭(PHPStudy 从别的电脑迁移过来)

    原文:phpStudy2018安装完成之后,Apache刚启动就关闭 版权声明:本文为博主原创文章,未经博主允许不得转载.用于学习总结等. https://blog.csdn.net/pjz16102 ...

  6. Linux性能测试 top命令

    原文地址:http://www.cnblogs.com/txw1958/archive/2012/07/25/linux-top-command.html top命令是Linux下常用的性能分析工具, ...

  7. 使用WinPcap获取网卡MAC地址

    关键字:WinPcap 网卡 MAC地址 作者:txw1958 在WpdPack_4_1_2\WpdPack\Examples-remote\PacketDriver\GetMacAddress\目录 ...

  8. Http请求格式(在Linux下使用telnet亲测,通过这篇我才明白)

    命令行窗口中用telnet测试HTTP协议请求消息格式响应消息格式1. 命令行窗口中用telnet测试HTTP协议 HTTP消息是由普通ASCII文本组成.消息包括消息头和数据体部分.消息头以行为单位 ...

  9. LAN公布java web项目的方法的外侧

    1.进入路由器设置页面:http://192.168.1.1 2.找到"转发规则"选项,我现在的路由器tp-link,不同型号tp-link"转发规则"选项位置 ...

  10. Why aren't more desktop apps written with Qt?(quora.com系列文章)

    As far as I know and have understood in my experience with Qt, it's a very good and easy to learn li ...