vue 编译提示安装 core-js,很有可能是这个错:

WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:npm install --save core-js@2    npm install --save core-js@3yarn add core-js@2              yarn add core-js@3

解决方案:

.babelrc

{"presets": [["@babel/env",{"targets": {"chrome": "58","ie": "10"},"useBuiltIns": "usage","corejs": "2"  //主要就是这里, 写2 或者 3 根据你安装的版本}]],"plugins": ["@babel/plugin-transform-runtime","@babel/plugin-syntax-dynamic-import","@babel/plugin-proposal-object-rest-spread","transform-vue-jsx",["component", {"libraryName": "mint-ui","style": true}]]
}

package.json

"devDependencies": {"@babel/core": "^7.6.4","@babel/plugin-transform-runtime": "^7.6.2","@babel/preset-env": "^7.6.3","babel-core": "^7.0.0-bridge.0","babel-loader": "^7.1.5","babel-plugin-component": "^1.1.1","babel-preset-es2015-node6": "^0.4.0","clean-webpack-plugin": "^0.1.17","clipboard-polyfill": "^2.8.6","copy-webpack-plugin": "^4.5.2","cross-env": "^5.2.0","css-loader": "^0.28.8","eslint-config-prettier": "^6.0.0","eslint-plugin-prettier": "^3.1.0","extract-text-webpack-plugin": "^4.0.0-beta.0","file-loader": "^1.1.11","glob": "^7.1.2","html-loader": "^0.5.5","html-webpack-plugin": "^3.0.6","jquery": "^2.2.4","less": "^3.9.0","less-loader": "^4.1.0","node-sass": "^4.11.0","open": "^0.0.5","postcss": "^7.0.2","postcss-loader": "^2.1.5","postcss-preset-env": "^5.2.1","postcss-short": "^4.1.0","postcss-sorting": "^3.1.0","raw-loader": "^0.5.1","sass-loader": "^6.0.7","shelljs": "^0.8.2","style-loader": "^0.20.3","url-loader": "^1.1.2","vue-loader": "^14.0.3","vue-router": "^3.0.2","vue-template-compiler": "^2.5.16","vue-touch": "^2.0.0-beta.4","webpack": "^4.2.0","webpack-cli": "^3.0.8","webpack-dev-server": "^3.1.1","webpack-merge": "^4.1.3","webpack-spritesmith": "^0.4.1"},"dependencies": {"@babel/polyfill": "^7.6.0","@babel/runtime": "^7.6.3","autoprefixer": "^9.5.0","axios": "^0.18.0","babel-plugin-transform-vue-jsx": "^3.7.0","core-js": "^2.6.10",  //  根据这里选择 上面core 的版本"eslint": "^5.0.0","eslint-plugin-vue": "^5.2.3","fundebug-javascript": "^2.0.0","fundebug-revideo": "^0.6.0","fundebug-vue": "0.0.1","mint-ui": "^2.2.13","qrcode": "^1.4.1","regenerator-runtime": "^0.13.3","styled-jsx": "^3.2.2","swiper": "^4.5.0","typescript": "^3.5.2","underscore": "^1.9.1","vue": "^2.5.16","vue-awesome-swiper": "^3.1.3","vue-baberrage": "^2.1.9","vue-lazyload": "^1.3.3","vue-resource": "^1.5.1","vuex": "^3.1.0"},

core-js@2 core-js@3报错问题相关推荐

  1. 调用http时因为js问题遇到的一个报错

    调用http时因为js问题遇到的一个报错 如果在使用其他语言调用http进行读取页面数据.获取页面源代码.接口调试等等时遇到了以下的报错: <html> <body> < ...

  2. ? php 为啥报错,如何解决js里面的php代码报错问题

    在一个模块中,前端是extjs,后端是php,报错,这是在php的错误警告开到最严格的时候报的错,虽然程序可以跑,可是日志堆积越来越多. Undefined variable:loginUserNam ...

  3. 迅雷插件导致js获取后端返回结果报错问题

    最近在调试公司一个项目,其中使用了js,在登录该系统时,页面不能正常跳转.但是我使用别的浏览器(调试使用的是谷歌浏览器)能够正常跳转.这就很奇怪,使用页面调试工具,获取到后端的返回结果如下图: < ...

  4. vue app.js <!doctype html>报错 Unexpected token ‘<‘ 作者:哇塞大嘴好帅

    vue app.js <!doctype html>报错 Unexpected token '<' 作者:哇塞大嘴好帅 作者:哇塞大嘴好帥(哇塞大嘴好帅) 首先我们看下错误 确保我们 ...

  5. js[mqtt线上环境报错net.createConnection is not a function]

    报错版本: mqtt 4.2.x 版本 官方issues https://github.com/mqttjs/MQTT.js/issues/1140 报错内容: 解决方案: 降低版本,并且将 '^' ...

  6. html页面调用js文件里的函数报错onclick is not defined问题(作用域问题)

    // 多个tr标签<tr> <td><a href="javascript:void(0);">删除</a></td> ...

  7. vue3+ts引入第三方js包,避免关键字报错

    项目要使用第三方包leaflet 在入口文件index.html中引入之后,使用的时候ts检查时关键字L就会报错 第一种方法 用 ** //@ts-ignore**,在用了L关键字的每一行上面加这个 ...

  8. .net core 部署到 iis 步骤及报错解决方法

    我写了一个Asp.net core mvc项目,但是部署在iis发生了502.5的问题一直解决不了. 环境 系统:最强Win10; 工具:轻巧VS Code; 各种百度bing都没有我要的解决方案,说 ...

  9. Segmentation fault (core dumped) -llinux系统内存错误报错信息

    目录 1 问题原因 (1)内存访问越界 (2)多线程程序使用了线程不安全的函数. (3)多线程读写的数据未加锁保护. (5)堆栈溢出. 2 使用GDB查看core文件 3 使用GDB调试程序 返回目录 ...

  10. nginx找不到静态(css,js,html)文件404报错,root的解析

    刚入门pythonweb的时候不知道nginx的配置文件为何物,也不知道怎么配置,找不到静态文件是很正常的. 首先举个栗子: 如果你web移植到服务器端后找不到静态文件,首先打开页面->右键-& ...

最新文章

  1. [luoguP2618] 数字工程(DP)
  2. 零基础python必背代码-零基础小白Python入门必看:通俗易懂,搞定深浅拷贝
  3. dqs server sql_SQL-Server(一)数据库的基本概念
  4. 用java写的常见排序
  5. TTL转USB TTL 232 CH340
  6. HTML查看器PC,PE文件查看器(PeViewer)
  7. 计算机术语仿真,计算机仿真-精.ppt
  8. 解决502 bad gateway的九种方案及原因
  9. 爬取人民日报_抓取人民日报
  10. 计算机自动开机什么愿意,电脑自动开关机是什么原因 怎么解决呢
  11. 关于TIdTCPClient的几种方法
  12. 【EtherCAT从站(SPI)扩展模块电路分析】
  13. docker网络原理及cgroup
  14. android 隐藏虚拟键盘,android隐藏全面屏虚拟键盘实现
  15. ae怎样设置gpu渲染
  16. 9102了,你还不了解互联网公司的一键登录?
  17. 光明区关于促进科技创新的若干措施(征求意见稿)
  18. 稻城亚丁6日游之第四天(稻城-理塘-雅江-新都桥)
  19. Android各大发布市场
  20. 背调公司要我提供个税APP的录屏和截图,这违法吗?

热门文章

  1. elasticsearch 安装过程中可遇到的问题
  2. 用贝叶斯来看看抛硬币的概率
  3. scp传输文件,自动填充密码
  4. [转载]Linux下getopt()函数的简单使用
  5. 【小松教你手游开发】【unity系统模块开发】Unity5.5.2UI打包AssetBundle
  6. 彻底完全卸载 SQL Server 2005 的图文教程
  7. Android中文API (39) —— AbsSpinner
  8. PartialView 加载Js
  9. 程序员如何优雅地使用 Mac?
  10. 解决 Gradle 进行多模块开发时,模块相互依赖的问题