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

你可能感兴趣的:(知识总结,vue.js,elementui)