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. R 语言基本操作(基本信息的查看、与本地文件系统交互、编译器版本升级)

    0. 信息及路径的查看 getwd() ⇒ 查看路径: setwd() ⇒ 设置路径: .libPaths() ⇒ R 语言库所在的位置: sessionInfo() ⇒ 查询版本及系统和库等信息: ...

  2. Eclipse中设置自定义文档签名

    今天第一次认真学习eclipse的使用,看到自定义文档签名,步骤如下: 1.点击window->preferences->java->Code Style->Code Temp ...

  3. 计算广告(computational advertising)

    计算广告学是一门由信息科学.统计学.计算机科学以及微观经济学等学科交叉融合的新兴分支学科. 1. 课程与资源 Andrei Broder:美国工程院院士,计算广告概念的提出者: MS&E 23 ...

  4. WPF 同一窗口内的多线程/多进程 UI(使用 SetParent 嵌入另一个窗口)

    原文 WPF 同一窗口内的多线程/多进程 UI(使用 SetParent 嵌入另一个窗口) WPF 的 UI 逻辑只在同一个线程中,这是学习 WPF 开发中大家几乎都会学习到的经验.如果希望做不同线程 ...

  5. delphi xe 之路(14)使用FireMonkeyStyle(一共30篇)

    FireMonkey使用Style来控制控件的显示方式. 每个控件都有一个StyleLookup属性,FireMonkey就是通过控件的这个属性来在当前窗体的StyleBook控件中查找匹配的Styl ...

  6. 深入理解最强桌面地图控件GMAP.NET --- 街景地图(StreetView)

    原文:深入理解最强桌面地图控件GMAP.NET --- 街景地图(StreetView) 很久没有更新博客了,今天无事把GMAP.NET的代码又重新翻了翻,看到了街景地图的例子. 街景地图是谷歌最早提 ...

  7. 讨论IM软件“网上假货’

    概要 网上假货.在不能使用网络的情况下,IM软件还显示在线. 网上是假的"在线--当前离线"之间的状态,在这段时期.用户无法发送消息.用户可以创建假冒网上心跳的错觉(点击了解).缓 ...

  8. RTB业务知识2-Open-RTB全景

    一个.前言 openrtb这是一套开源的竞价广告系统,来自IAB贡献,井. 有许多值太借鉴,提供sdk api接口文档介绍,整理了相关的资料.主要包含其生态图体系.业务流程和基本的对象模型和数据模型. ...

  9. HDU-4249-A Famous Equation(DP)

    Problem Description Mr. B writes an addition equation such as 123+321=444 on the blackboard after cl ...

  10. gitlab 添加文件到新建git库

    1. 账号拥有master权限 2.执行操作 git clone git@IP:Group/project.gitcd projecttouch README.mdgit add README.mdg ...