尚硅谷_在线教育_Nuxt整合错误
作者:互联网
直接引用vue-front-1010 模板,执行npm run dev时报错。
ERROR in ./.nuxt/client.js friendly-errors 20:20:03
Module build failed (from ./node_modules/babel-loader/lib/index.js): friendly-errors 20:20:03
Error: [BABEL] D:\workspace\workspace_vue\aaa\test\vue-front-1010\.nuxt\client.js: Cannot find module 'D:\workspace\workspace_vue\aaa\test\vue-front-1010\node_modules\@babel\compat-data\data\corejs3-shipped-proposals' (While processing: "D:\\workspace\\workspace_vue\\aaa\\test\\vue-front-1010\\node_modules\\@nuxt\\babel-preset-app\\src\\index.js")
at createEsmNotFoundErr (internal/modules/cjs/loader.js:916:15)
at finalizeEsmResolution (internal/modules/cjs/loader.js:909:15)
at resolveExports (internal/modules/cjs/loader.js:449:14)
at Function.Module._findPath (internal/modules/cjs/loader.js:489:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:875:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (D:\workspace\workspace_vue\aaa\test\vue-front-1010\node_modules\@babel\preset-env\lib\polyfills\corejs3\usage-plugin.js:10:55)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (D:\workspace\workspace_vue\aaa\test\vue-front-1010\node_modules\@babel\preset-env\lib\index.js:29:44)
执行
npm install @babel/compat-data
如果还是出错,则删掉源码的.nuxt和node_modules
重新执行
npm install
标签:vue,modules,js,在线教育,internal,cjs,硅谷,loader,Nuxt 来源: https://blog.csdn.net/weixin_41673606/article/details/120751615