Vue中使用Element-ui时报错

 Error: Cannot find module 'babel-preset-es2015'
Require stack:
        - D:\webDesign_study_projects\Vue\vue_router\node_modules\@babel\core\lib\config\files\plugins.js
       - D:\webDesign_study_projects\Vue\vue_router\node_modules\@babel\core\lib\config\files\index.js 
        - D:\webDesign_study_projects\Vue\vue_router\node_modules\@babel\core\lib\index.js
        - D:\webDesign_study_projects\Vue\vue_router\node_modules\@vue\cli-plugin-babel\index.js
        - D:\webDesign_study_projects\Vue\vue_router\node_modules\@vue\cli-service\lib\Service.js        
        - D:\webDesign_study_projects\Vue\vue_router\node_modules\@vue\cli-service\bin\vue-cli-service.js
        Make sure that all the Babel plugins and presets you are using
        are defined as dependencies or devDependencies in your package.json
        file. It's possible that the missing plugin is loaded by a preset
        you are using that forgot to add the plugin to its dependencies: you
        can workaround this problem by explicitly adding the missing package
        to your top-level package.json.

【解决方案】:

将babel.config.js文件中的

["es2015", { "modules": false }]

修改为:

["@babel/preset-env", { "modules": false }]

相关推荐

  1. Vue使用Element-ui时报

    2024-02-20 06:58:06       44 阅读
  2. UI 神器 - Vue3 如何使用 element-plus

    2024-02-20 06:58:06       43 阅读
  3. element-UIel-scrollbar的使用

    2024-02-20 06:58:06       58 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-20 06:58:06       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-20 06:58:06       100 阅读
  3. 在Django里面运行非项目文件

    2024-02-20 06:58:06       82 阅读
  4. Python语言-面向对象

    2024-02-20 06:58:06       91 阅读

热门阅读

  1. 新鼠标的长宽高

    2024-02-20 06:58:06       44 阅读
  2. 每天一个数据分析题(一百六十)

    2024-02-20 06:58:06       55 阅读
  3. 数衍科技连接CRM和营销系统,无代码API集成

    2024-02-20 06:58:06       42 阅读
  4. 自动驾驶---Motion Planning之LaneChange

    2024-02-20 06:58:06       55 阅读
  5. 设计模式(行为型模式)解释器模式

    2024-02-20 06:58:06       42 阅读
  6. Zookeeper

    Zookeeper

    2024-02-20 06:58:06      36 阅读
  7. MySQL的安装和备份

    2024-02-20 06:58:06       52 阅读