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. HTML:描述语义

    一.HTML HTML:Hypertext Markup Launguage,超文本标记语言,是网页的就文件格式,用于描述网页语义. 二.HTML骨架 DTD手册:http://www.w3schoo ...

  2. poj 3071 可能DP

    http://poj.org/problem? id=3071 推方程不难,可是难在怎么算 dp[i][j]表示第i场时第j仅仅队伍存活下来的概率 方程:dp[i][j]=sigma(dp[i-1][ ...

  3. Visual Studio Code同时debug多种代码的方式

    今天看了一下,猜应该是configurations里面多写一个就行,试了下,真的可以同时debug Python和Go代码. 可以打断点.单步执行Python和Go代码. launch.json 如下 ...

  4. linux awk(good)

    一个用awk处理字符串的例子: #!/bin/bash source="nokia201703148855" preffixStr=$(echo $source |awk '{pr ...

  5. EMES信息化制造系统的概念

    EMES是指,信息化制造系统.它由五个功能子系统构成,分别是:企业信息平台子系统(EIP),物料实时信息系统(MRI).能源实时信息系统(PRI).设备实时信息系统(EMR).质量实时信息系统(QRI ...

  6. Akka边学边写(1)-- Hello, World!

    Akka Akka是什么呢?直接引用Akka站点上面的描写叙述吧: Akka is a toolkit and runtime for building highly concurrent, dist ...

  7. Bootstrap Button 使用方法

    Getting Started <!-- basic button --> <com.beardedhen.androidbootstrap.BootstrapButton andr ...

  8. leetcode先刷_Pascal&#39;s Triangle II

    三角相对简答题.第一个问题是太简单.我不沾了,我一定会写.其实没什么的第二个问题,与这个问题计算路径有点像一个三角形,假定输入是n,然后从第一行计数到第一n行,保存在数据线上的时间到,由于只有相关的事 ...

  9. doker基础

    去 Docker Hub 上拉取一个叫 hello-world 的集装箱docker pull hello-world然后让这个集装箱跑起来docker run hello-world查看本机所安装的 ...

  10. 解决Ubuntu14.04在外接显示器不能指定问题的最佳分辨率

    通常这种情况发生.在System Settings -> display 你会发现多出了一个 unknown display. 这往往是因为你使用质量低劣的视频电缆,例如,几美元VGA线. 解决 ...