Construction of nuxt with koa, and error solutions

1.vue init nuxt-community/koa-template nuxt-learn

2. yarn install or npm install

3.npm run dev

Error occurs
ERROR  Failed to compile with 1 errors20:10:54

 error  in ./server/index.js

Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In D:\vue\VueBase\nuxt-learn\node_modules\backpack-core\babel.js
    at createDescriptor (D:\vue\VueBase\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:178:11)
    at D:\vue\VueBase\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:109:50
    at Array.map (<anonymous>)
    at createDescriptors (D:\vue\VueBase\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:109:29)
    at createPresetDescriptors (D:\vue\VueBase\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:101:10)
    at D:\vue\VueBase\nuxt-learn\node_modules\@babel\core\lib\config\config-descriptors.js:58:104
    at cachedFunction (D:\vue\VueBase\nuxt-learn\node_modules\@babel\core\lib\config\caching.js:62:27)
    at cachedFunction.next (<anonymous>)
    at evaluateSync (D:\vue\VueBase\nuxt-learn\node_modules\gensync\index.js:244:28)
    at sync (D:\vue\VueBase\nuxt-learn\node_modules\gensync\index.js:84:14)

internal/modules/cjs/loader.js:796
    throw err;
    ^

Error: Cannot find module 'D:\vue\VueBase\nuxt-learn\build\main.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

As the white one, do not know how to solve it to Baidu to find solutions to solve the first reference of this blog is to solve https://blog.csdn.net/weixin_44290787/article/details/89300823
According to this blog is to solve the problem, but later in accordance with the koa-router when a terminal error
'backpack' ▒▒▒▒▒ڲ▒▒▒▒ⲿ▒▒▒Ҳ
This is even more ignorant I finally had no choice but to delete the item, and do it again, and finally solve the problem under the guidance of this blog a https://blog.csdn.net/luoyu19940615/article/details/90694297
Installation steps listed last
vue init nuxt-community/koa-template nuxt-learn
npm install
npm run dev
npm install backpack-core@0.7.0 --save-dev

// 在nuxt.config.js里找到eslint-loader将ctx.isClient改成ctx.Client就可以运行了。
 extend (config, ctx) {
      if (ctx.Client) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
Published 33 original articles · won praise 0 · Views 648

Guess you like

Origin blog.csdn.net/qq_43477721/article/details/104703863