请选择 进入手机版 | 继续访问电脑版
MSIPO技术圈 首页 IT技术 查看内容

Vue中使用Element-ui时报错

2024-02-20

 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 }]

相关阅读

热门文章

    手机版|MSIPO技术圈 皖ICP备19022944号-2

    Copyright © 2024, msipo.com

    返回顶部