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. 使用CMD实现批量重命名[转]

    关键字:cmd DOS 批处理 批量 重命名 作者:lifesinger地址:http://www.cnblogs.com/txw1958/archive/2012/12/24/cmd-batch-r ...

  2. 概率分布的 perplexity

    1. 一种 measurement 信息论中,perplexity is a measurement of how well a probability distribution or probabi ...

  3. Jenkins 部署

    1  修改jenkins的根目录,默认地在C:\Documents and Settings\AAA\.jenkins . .jenkins ├─jobs│  └─JavaHelloWorld│    ...

  4. Swift 中使用 SwiftyJSON 制作一个比特币价格 APP

    Swift 中处理 JSON 数据有很多种方式,可以使用原生的 NSJSONSerialization,也可以使用很多第三方库.原生的 NSJSONSerialization 方式这篇文章中介绍过.这 ...

  5. WPF DataGrid 触发器

    <DataGrid.RowHeaderStyle> <Style TargetType="DataGridRowHeader"> <Style.Tri ...

  6. jquery map()的用法--遍历数组

    <!DOCTYPE html><html><head><meta http-equiv="Content-Type" content=&q ...

  7. VisualSVN5.1.7补丁原创发布

    VisualSVN5.1.7补丁原创发布 一切尽在发布中.

  8. 通通玩blend美工(7)——简约而不简单的块

    原文:通通玩blend美工(7)--简约而不简单的块 最近在研发一个WPF快速开发框架,满脑子都是各种逻辑各种模式,写一篇比较休闲娱乐的博客,宣泄下我对美工的热爱. 我一直以来有意无意在手机应用或者各 ...

  9. WPF之VirtualizingStackPanel.IsVirtualizing="False"

    原文:WPF之VirtualizingStackPanel.IsVirtualizing="False" 相信从winform转到wpf的人都遇到过这样的困惑,在处理DataGri ...

  10. javascript控制rem字体大小

    摘要:在写响应式H5页面的时候,我常常会用rem字体,为了兼容多个分辨率的设备,需要写多个@media标签,太麻烦并且不够精致,尤其是移动端的页面往往达不到我想要的效果,后来就用js替代了css的@m ...