vue-cli做项目中遇到的各种bug笔记方案
(1)VUE3.X版本@vue/cli 3.x遇到error: Parsing error: Unexpected token解决办法
.(1)安装eslint-plugin-vue依赖
npm install eslint-plugin-vue -D
(2)在.eslint.js配置文件中添加如下配置
module.exports = {
root: true,
parserOptions: {
sourceType: 'module'
},
parser: "vue-eslint-parser",
env: {
browser: true,
node: true,
es6: true,
},
rules: {
'no-console': 'off',
}
}
(2)重启node
npm run serve
在使用Vue3.x和@vue/cli3.x开发过程中遇到'error: Parsing error: Unexpected token'的问题,可以按照以下步骤解决:首先,通过npm安装eslint-plugin-vue依赖;然后,在.eslint.js配置文件中添加指定的解析器配置;最后,重启node服务执行npm run serve。这样可以确保项目正常运行,避免语法错误。
1409

被折叠的 条评论
为什么被折叠?



