Nuxt.js vue init nuxt-community/koa-template 初始化项目报错
报错提示:
Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In G:\project\vue\nuxt-learn\node_modules\backpack-core\babel.js
问题原因:backpack-core模块版本低。
解决:更新backpack-core
npm install --save-dev backpack-core@0.7.0
安装警告:
npm WARN uglifyjs-webpack-plugin@0.4.6 requires a peer of webpack@^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3.0.0 but none is installed. You must install peer dependencies yourself.
更新插件:
npm view uglifyjs-webpack-plugin versions
npm i -D uglifyjs-webpack-plugin@2.2.0
运行项目:
npm run dev
报错:
Module build failed (from ./node_modules/eslint-loader/index.js):
TypeError: Cannot read property 'eslint' of undefined
at Object.module.exports (G:\project\vue\nuxt-learn\node_modules\eslint-loader\index.js:148:18)
解决:根目录下nuxt.config.js 更改 ctx.isClient 为 ctx.Client