vueのnpm run dev报错Parsing error: The keyword 'import' is reserved

版权声明:版权属 ©胖子ღ牛逼,微信:xuewen-weiboweixin https://blog.csdn.net/z_xuewen/article/details/85316639

需要配置 eslint,在项目目录下建立 .eslintrc.js 的方式来配置。

module.exports = {
    root: true,
    parserOptions: {
        sourceType: 'module'
    },
    // required to lint *.vue files
    plugins: [
        'html'
    ],
    // add your custom rules here
    'rules': {
        // allow debugger during development
        'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
    }
}

配置完重新启动即可

猜你喜欢

转载自blog.csdn.net/z_xuewen/article/details/85316639