ERROR Failed to compile with 1 errors friendly-errors 09:48:15 ERROR in ./.nuxt/client.js friendly-errors 09:48:15 Module build failed (from ./node_modules/babel-loader/lib/index.js): friendly-errors 09:48:15 Error: [BABEL] D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\.nuxt\client.js: Cannot find module '@babel/compat-data/corejs3-shipped-proposals' Require stack: - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\@babel\preset-env\lib\polyfills\corejs3\usage-plugin.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\@babel\preset-env\lib\index.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\@nuxt\babel-preset-app\src\index.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\@babel\core\lib\config\files\plugins.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\@babel\core\lib\config\files\index.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\@babel\core\lib\index.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\babel-loader\lib\index.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\loader-runner\lib\loadLoader.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\loader-runner\lib\LoaderRunner.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\webpack\lib\NormalModule.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\webpack\lib\NormalModuleFactory.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\webpack\lib\Compiler.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\webpack\lib\webpack.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\@nuxt\webpack\dist\webpack.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\@nuxt\cli\dist\cli-command.js - D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\nuxt\bin\nuxt.js (While processing: "D:\\project\\myself\\front_parent\\vs2020\\vue-front-1010\\vue-front-1010\\node_modules\\@nuxt\\babel-preset-app\\src\\index.js") at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15) at Function.Module._load (internal/modules/cjs/loader.js:842:27) at Module.require (internal/modules/cjs/loader.js:1026:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\@babel\preset-env\lib\polyfills\corejs3\usage-plugin.js:10:55) at Module._compile (internal/modules/cjs/loader.js:1138:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) at Module.require (internal/modules/cjs/loader.js:1026:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (D:\project\myself\front_parent\vs2020\vue-front-1010\vue-front-1010\node_modules\@babel\preset-env\lib\index.js:29:44) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) friendly-errors 09:48:15 @ multi eventsource-polyfill webpack-hot-middleware/client?reload=true&timeout=30000&ansiColors=&overlayStyles=&name=client&path=/__webpack_hmr/client ./.nuxt/client.js
在vue项目启动时,出现如上所示的错误,解决方法,在集成终端执行如下代码:
npm install @babel/core @babel/preset-env
出现如上所示结果,按照提示,输入命令:npm audit fix
npm audit fix
然后再输入:npm run dev即可。