nuxt.js-------koa2项目,环境错误一次性解决

nuxt.js虽然好用但是自己的脚手架安装完全是坑

cnpm run dev 报错确实main.js

node环境nuxt版本不匹配,在网上找了很多解决方法没有解决,就一次性把所有脚手架和环境都升级到最新版本

npm install backpack-core@latest eslint-loader@latest eslint-plugin-html@latest --save --dev

在升级eslint

npm install eslint@latest

完美解决

项目跑起来还会要到bug

Module Error (from ./node_modules/[email protected]@eslint-loader/dist/

//配置eslint
 extends: {
        plugin: vue / recommended
    },

最后项目可以跑起来了还有警告

Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

我们修改nuxt,config.js

注释extend里面的内容

build: {
        /*
         ** Run ESLINT on save
         */
        extend(config, ctx) {
            // if (ctx.isClient) {
            //   config.module.rules.push({
            //     enforce: 'pre',
            //     test: /\.(js|vue)$/,
            //     loader: 'eslint-loader',
            //     exclude: /(node_modules)/
            //   })
            // }
        }
    }
发布了71 篇原创文章 · 获赞 21 · 访问量 3665

猜你喜欢

转载自blog.csdn.net/qq_26386437/article/details/104154505