Error: Cannot find module '@babel/runtime/core-js/object/keys'(npm start报错)
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报错)的更多相关文章
- 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 一. 问题描述 在 ...
- webpack.config.js配置遇到Error: Cannot find module '@babel/core'问题
在webpack配置,将ES6转成ES5的时候,,出现Error: Cannot find module '@babel/core'错误最初以为是babel-core没有安装上.重装了好几遍babel ...
- 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 ...
- vue报错-Error: Cannot find module '@babel/core'
vue之webpack实战的时候遇到报错,Error: Cannot find module '@babel/core' 这报错,我百度了很久,后来发现报错里面有提示,发现是我的 babel-load ...
- Error: Cannot find module '../lib/utils/unsupported.js'
报错: nodejs : Error: Cannot find module '../lib/utils/unsupported.js' 解决办法(linux): 去node目录下:/node***/ ...
- babel把ES6转化为ES5的时候报错
Module not found: Error: Can't resolve '@babel/runtime/helpers/asyncToGenerator' in 'e:\Node.js\Node ...
- 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,& ...
- 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 ...
- Error: Cannot find module '@babel/core'
报错如下 产生原因 babel-loader和babel-core版本不对应所产生的, babel-loader 8.x对应babel-core 7.x babel-loader 7.x对应babel ...
随机推荐
- CUDA atomic原子操作
CUDA的原子操作可以理解为对一个变量进行"读取-修改-写入"这三个操作的一个最小单位的执行过程,这个执行过程不能够再分解为更小的部分,在它执行过程中,不允许其他并行线程对该变量进 ...
- 贝叶斯推理(Bayes Reasoning)、独立与因式分解
P(X,Y)=P(X)P(Y),X⊥Y P(X,Y,Z)∝ϕ1(X,Z)ϕ2(Y,Z),(X⊥Y∣∣Z) 1. Reasoning patterns causal reasoning 由原因到结果的一 ...
- WPF MVVM模式中,通过命令实现窗体拖动、跳转以及显隐控制
原文:WPF MVVM模式中,通过命令实现窗体拖动.跳转以及显隐控制 在WPF中使用MVVM模式,可以让我们的程序实现界面与功能的分离,方便开发,易于维护.但是,很多初学者会在使用MVVM的过程中遇到 ...
- 倒计时的CountDownTimer
直接看这里吧,我仅仅是搬运工. 定时运行在一段时候后停止的倒计时,在倒计时运行过程中会在固定间隔时间得到通知(译者:触发onTick方法),以下的样例显示在一个文本框中显示一个30s倒计时: , 1 ...
- CSRF 专题
一.CSRF是什么? CSRF(Cross-site request forgery),中文名称:跨站请求伪造. 也被称为:one click attack/session riding(一 ...
- python3批量查询域名是否注册
#!/usr/local/bin/python3 #coding=utf-8 import re,sys,os,random,time, base64 import urllib.parse, url ...
- POJ3723 Conscription 【并检查集合】
Conscription Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8071 Accepted: 2810 Desc ...
- React学习(2)——action,reducer
action creator 是一个函数,格式如下: var actionCreator = function() { // 构建一个 action 并返回它 return { type: 'AN_A ...
- RGB565与RGB555标志识别位图文件格式
近日从本地16比特位图读出象素彩色数据,并填充ANDROID的BITMAP数据.发现,使用CAVAS当屏幕显示,照片显示的颜色不正确,找了很多资料,原来发现两个原因: 1.将位图的颜色分量掩码弄错了, ...
- mysql重置root密码,并设置可远程访问
linux系统: mysqld_safe --skip-grant-tables & mysql -u root use mysql UPDATE user SET host = '%' wh ...