码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • vue报错信息汇总


    报错信息汇总

    • 1、报错信息:Missing space before function parentheses
    • 2、报错信息:Extra semicolon semi
    • 3、报错信息: Unexpected trailing comma comma-dangle
    • 4、报错信息:error Strings must use singlequote quotes
    • 5、报错信息:import/no-duplicates
    • ***6、错误信息:Newline required at end of file but not found eol-last***
    • 7、npm install vue-router --save-dev 错误提示如下
    • 8、vue 2 npm install vue-router --save-dev 错误信息
    • 9、Newline required at end of file but not found eol-last 错误信息
    • 10、Missing space before function parentheses space-before-function-paren 错误信息
    • 11、- vue@2.6.11 (D:\chezaiwork\odcp-knowledge-qa\node_modules\vue\dist\vue.runtime.common.js)
    • 12、Uncaught Error: Catch all routes ("*") must now be defined using a param with a custom regexp.
    • 13、Object.fromEntries is not a function electron-vue
    • 14、 Verion 9 of Highlight.js has reached EOL. It will no longer
    • 15、ReferenceError: Unknown plugin "component" specified in
    • 15、Application entry file "dist\electron\main.js" in the "D:\r*****" does not exist. Seems like a wrong configuration. stackTrace=

    1、报错信息:Missing space before function parentheses

    函数括号前缺少空格
    解决:在.eslint文件的rules种添加代码:

    'space-before-function-paren': 0
    
    • 1

    2、报错信息:Extra semicolon semi

    使用 vue-cli 构建的项目默认的 eslint 配置要求是不能使用分号
    解决:在.eslint文件的rules中添加

    'semi': 0
    
    • 1

    3、报错信息: Unexpected trailing comma comma-dangle

    解决:在.eslint文件的rules中添加

    'comma-dangle': 0
    
    • 1

    4、报错信息:error Strings must use singlequote quotes

    单引号变双引号
    解决:在.eslint文件的rules中添加

    'quotes': 'off'
    
    • 1

    5、报错信息:import/no-duplicates

    原因是多次引用同一模块导致。
    解决:在.eslint文件的rules中添加

    'no-duplicate-imports': 0
    
    • 1

    6、错误信息:Newline required at end of file but not found eol-last

    代码最后一行没有空一行

    7、npm install vue-router --save-dev 错误提示如下

    在这里插入图片描述
    npm ERR! this command with --force, or --legacy-peer-deps
    根据这行提示
    在原本npm install 语句后面加上–force或者–legacy-peer-deps
    原理:给npm 降级
    原本语句:
    npm install vue-router --save-dev
    解决:
    npm install vue-router --save-dev --legacy-peer-deps

    8、vue 2 npm install vue-router --save-dev 错误信息

    在这里插入图片描述
    默认下载的版本太高是4的,一般搭配vue3使用,vue2上起不来
    (1) 卸载当前的vue-router

    npm uninstall vue-router
    
    • 1

    (2)安装指定版本的vue-router

    npm install vue-router@3.1.3
    
    • 1

    9、Newline required at end of file but not found eol-last 错误信息

    在这里插入图片描述最后一行需留空行

    10、Missing space before function parentheses space-before-function-paren 错误信息

    在这里插入图片描述
    方法名和刮号之间需要有一格空格

    11、- vue@2.6.11 (D:\chezaiwork\odcp-knowledge-qa\node_modules\vue\dist\vue.runtime.common.js)

    vue-template-compiler@2.7.14 (D:\chezaiwork\odcp-knowledge-qa\node_modules\vue-template-compiler\package.json)
    在这里插入图片描述
    解决方案 找到相关文件将其删除
    在这里插入图片描述

    第一步:执行npm uninstall vue-template-compiler
    第二步:执行npm install vue-template-compiler@报错中提示的vue的版本号
    
    • 1
    • 2

    并看一下 vue得版本是否是图中得版本号
    如果不是 则npm uninstall vue ; npm install vue@错误中提示得vue版本号
    解决后如下
    在这里插入图片描述

    12、Uncaught Error: Catch all routes (“*”) must now be defined using a param with a custom regexp.

    在这里插入图片描述
    错误:

    const routes = [
        {
            path: '*',
            name: '404',
            component: () => import('@/views/404.vue')
        }
    ]
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    解决方案:// 根据报错信息可得 必须使用正则表达式

    const routes = [
        {
            // 匹配所有路径  vue2使用*   vue3使用/:pathMatch(.*)*或/:pathMatch(.*)或/:catchAll(.*)
            path: '/:pathMatch(.*)*',
            name: '404',
            component: () => import('@/views/404.vue')
        }
    ]
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    13、Object.fromEntries is not a function electron-vue

    在这里插入图片描述

    npm install polyfill-object.fromentries
    
    • 1

    在这里插入图片描述

    // 引入
    import 'polyfill-object.fromentries'
    
    • 1
    • 2

    在这里插入图片描述

    14、 Verion 9 of Highlight.js has reached EOL. It will no longer

    在这里插入图片描述

    npm install highlight.js@9.3.0
    
    • 1

    15、ReferenceError: Unknown plugin “component” specified in

    在这里插入图片描述

    npm install babel-plugin-component@1.1.1
    
    • 1

    15、Application entry file “dist\electron\main.js” in the “D:\r*****” does not exist. Seems like a wrong configuration. stackTrace=

    在这里插入图片描述
    出现错误的原因:.electron-vue\build.js文件中,代码中使用了 Multispinner ,但没有在开头引用,并且package.json文件中也没有这个依赖文件。

    npm install multispinner
    
    • 1

    在这里插入图片描述
    然后在.electron-vue\build.js文件中引用

    const Multispinner = require('multispinner')
    
    • 1

    在这里插入图片描述

  • 相关阅读:
    新框架Nue.js以及如何搭建框架(详细介绍)
    低代码+知识管理,打造智能化供应链管理系统
    YOLOv2—passthrough层
    windows linux子系统 docker无法启动
    1768.交替合并字符串
    北斗——1、北斗时空智能主机
    Flutter中系统Emoji通过substring裁切后无法识别导致渲染错误
    使用Spring Web Flow—Spring Web Flow的配置
    Zookeeper
    基于SSM的在线音乐管理系统
  • 原文地址:https://blog.csdn.net/weixin_43843679/article/details/126463108
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号