javascript - npm run build fails with "Error: custom keyword definition is invalid: data.errors should be boolean&q

I'm seeing an error with npm when I try to build a VueJS application. I'm seeing this error i

I'm seeing an error with npm when I try to build a VueJS application. I'm seeing this error inside of a build stage in GitLab CI. I haven't been able to find any mention of the error message. I have previously been able to run npm run build successfully and I haven't made any changes to the Vue application code, so I'm unsure what could be causing this error.

-  Building for production...
 ERROR  Error: custom keyword definition is invalid: data.errors should be boolean
Error: custom keyword definition is invalid: data.errors should be boolean
    at Ajv.addKeyword (/app/node_modules/ajv/lib/keyword.js:65:13)
    at module.exports (/app/node_modules/ajv-errors/index.js:10:7)
    at Object.<anonymous> (/app/node_modules/terser-webpack-plugin/node_modules/schema-utils/src/validateOptions.js:22:1)
    at Module._pile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A plete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-02-09T22_32_54_384Z-debug.log
The mand '/bin/sh -c npm run build' returned a non-zero code: 1
ERROR: Job failed: exit code 1

Here is what I have in my docker file that is used to build the Vue app:

# build stage
FROM node:10.14.2-jessie as build-stage
WORKDIR /app/
COPY frontend/package.json /app/
RUN npm cache verify
RUN npm install
COPY frontend /app/
RUN npm run build

I'm seeing an error with npm when I try to build a VueJS application. I'm seeing this error inside of a build stage in GitLab CI. I haven't been able to find any mention of the error message. I have previously been able to run npm run build successfully and I haven't made any changes to the Vue application code, so I'm unsure what could be causing this error.

-  Building for production...
 ERROR  Error: custom keyword definition is invalid: data.errors should be boolean
Error: custom keyword definition is invalid: data.errors should be boolean
    at Ajv.addKeyword (/app/node_modules/ajv/lib/keyword.js:65:13)
    at module.exports (/app/node_modules/ajv-errors/index.js:10:7)
    at Object.<anonymous> (/app/node_modules/terser-webpack-plugin/node_modules/schema-utils/src/validateOptions.js:22:1)
    at Module._pile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A plete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-02-09T22_32_54_384Z-debug.log
The mand '/bin/sh -c npm run build' returned a non-zero code: 1
ERROR: Job failed: exit code 1

Here is what I have in my docker file that is used to build the Vue app:

# build stage
FROM node:10.14.2-jessie as build-stage
WORKDIR /app/
COPY frontend/package.json /app/
RUN npm cache verify
RUN npm install
COPY frontend /app/
RUN npm run build
Share Improve this question edited Feb 9, 2019 at 23:13 briancaffey asked Feb 9, 2019 at 22:52 briancaffeybriancaffey 2,56810 gold badges40 silver badges65 bronze badges 7
  • 2 Got the exact same error on a freshly install vue app. Mine was on npm run serve. – d00dle Commented Feb 9, 2019 at 23:10
  • 1 A look at the repo for the package shows the file reported by npm was updated an hour ago. Did you by any chance just update the npm dependencies? – d00dle Commented Feb 9, 2019 at 23:13
  • 2 The issue has been raised on the repo. Multiple dependent packages are hit. – d00dle Commented Feb 9, 2019 at 23:14
  • 2 It's a simple work around for now but it worked for me. I set "ajv": "6.8.1" -> github./rogeriochaves/npm-force-resolutions – Diemuzi Commented Feb 9, 2019 at 23:33
  • 1 Still getting this issue on 6.9.0 after npm update – Zach Commented Feb 10, 2019 at 7:38
 |  Show 2 more ments

3 Answers 3

Reset to default 5

https://github./webpack/webpack/issues/8768

If you use yarn

add below to package.json

  "resolutions": {
    "ajv": "6.8.1"
  }

then run yarn install

if you use npm

npm uninstall ajv
npm install [email protected]

In the node-modules I renamed ajv folder to ajv1. Now I copied an older version of ajv folder into node-modules folder from some other installation. It worked.

Quick fix:

Go to the ajv dependency in your node_modules folder:

node_modules/ajv/lib/keyword.js

ment out the line 64 and 65 :

if (!validateDefinition(definition))
  throw new Error('custom keyword definition is invalid: '  + this.errorsText(validateDefinition.errors));

and it should works without side effects.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745673553a4639548.html

相关推荐

  • WePush 一款基于模拟点击实现的微信消息推送机器人,安全稳定不封号

    微信每天都要用,所以很多系统监控的消息就直接推送到微信了,这样有什么问题也能很方便的及时收到提醒。但是呢,微信机器人现在封号太厉害了,用过wechaty,再到hook微信客户端,现在都是一挂就封,无奈了,只好走正规军的路子。Github:原

    1小时前
    20
  • 开发体育直播系统后台权限设计实践分享|ThinkPHP 技术栈落地案例

    今天我们分享的是一套由 东莞梦幻网络科技 自研的体育直播源码,在 ThinkPHP + MySQL 技术栈的加持下,后台权限系统如何从0到1落地,并支撑整个平台稳定运行。一、整体架构设计代码语言:html复制用户端(APPH5P

    1小时前
    20
  • 如何增加 Elasticsearch 中的主分片数量

    要增加现有索引的主分片数量,直接修改是不可能的。因此,如果你想增加主分片的数量,必须重新创建索引。通常有两种方法:_reindex API 和 _split API。在这两种方法中,_split API 通常比 _reindex API 更

    1小时前
    20
  • 文章降 AI 痕迹方法与工具速览

    文章降AI的方法和工具汇总‌如下: 这几天又认真研究类了一下,想让 AI 生成的文章更自然,摆脱程式化痕迹,可尝试以下方法。借助 GPT、文字滚筒鸭,朱雀大模型检测器、豆包、kimi 等大模型,输入文本后,它们能通过调整结构、替换同义词等操

    1小时前
    00
  • 用安信可Ai

    以下作品由安信可社区用户业余菜狗制作前言自从接触智能家居之后,笔者就变得很依赖智能家居(绝对不是懒!)比如卧室灯,就在进门的地方,进门开灯很方便,但是晚上睡觉关灯就很不方便。之前是买了一款Wi-Fi灯,是用手机APP操作,刚开始用的时候感觉

    1小时前
    00
  • MySQL8使用物理文件恢复MyISAM表测试

    我们现场测试一个场景,drop一张MyISAM表后,单独对这表进行物理恢复首先我们看一下secure_file_priv文件目录的位置代码语言:javascript代码运行次数:0运行复制mysql> show global vari

    1小时前
    00
  • 2025年最受欢迎的10款免费CRM软件大对比

    在数字化转型浪潮下,越来越多的企业开始重视客户关系管理(CRM)系统。一个高效的CRM不仅能帮助企业理清客户脉络,还能提升销售效率、优化服务体验。2025年,市场上涌现了众多优秀的免费CRM软件,本文将为大家对比10款最受欢迎的产品,助您选

    1小时前
    00
  • 万字图解 Java 并发框架:ForkJoin、CountDownLatch、Semaphore、CyclicBarrier

    本文图多,内容硬核,建议收藏。在第一章节《1.6w 字图解 Java 并发:多线程挑战、线程状态和通信、死锁;AQS、ReentrantLock、Condition 使用和原理》,我们开启了 Java 高并发系列的学习,透彻理解 Java

    53分钟前
    00
  • 1.8w字图解Java并发容器: CHM、ConcurrentLinkedQueue、7 种阻塞队列的使用场景和原理

    文章多图且内容硬核,建议大家收藏上一章《1.6w 字图解 Java 并发:多线程挑战、线程状态和通信、死锁;AQS、ReentrantLock、Condition 使用和原理》,我们开启了 Java 高并发系列的学习,透彻理解 Java 并

    51分钟前
    00
  • 电脑密码在哪里设置win11,win11电脑开机密码怎么设置

    Win11系统由于许多设置和以前系统不一样了&#xff0c;所以很多用户们操作非常不习惯&#xff0c;有很多的小伙伴不知道win11系统怎么设置开机密码。给电脑设置密码&#xff0c;只有自己能打开进入系统桌面&a

    50分钟前
    00
  • HLS最全知识库

    HLS最全知识库副标题-FPGA高层次综合HLS(二)-Vitis HLS知识库高层次综合(High-level Synthesis)简称HLS,指的是将高层次语言描述的逻辑结构,自动转换成低抽象级语言描述的电路模型的过程。对于AMD Xi

    46分钟前
    00
  • 国产之光!!让你的Docker管理更优雅!

    大家好,我是热爱开源的了不起!我们都知道,Docker是个好东西,能帮我们把应用打包成容器,方便部署和管理。但问题来了,Docker的命令行操作对新手来说有点复杂,一不小心就容易出错。而且,有时候我们只是想简单地管理一下容器,却得记住一堆命

    43分钟前
    00
  • 20 万 POC,直接拿来用,这不是测试,这是拒绝服务!!!

    之前看到很多人分享 github 上的一个项目,自动收录全网 nuclei 模板文件,目前已经 19 万了,如果直接拿来对目标进行漏洞探测,无疑会对目标造成巨大伤害,意味着可能要对目标发起十九万次请求以上,可以说是一次小型的 DDoS 攻击

    36分钟前
    00
  • 最简 Odoo 部署方法:Websoft9 企业应用托管平台

    传统方式部署 Odoo 通常依赖 Docker 技术,主要分为以下步骤:1 . 安装 Docker需在服务器上安装 Docker 引擎,涉及操作系统兼容性检查、依赖包安装、镜像源配置等操作。代码语言:bash复制 # 以 Ubu

    28分钟前
    00
  • Go 语言 Mock 实践

    Mock 是软件测试中的一项关键技术,尤其在单元测试领域,可谓是“顶梁柱”般的存在,几乎不可或缺。它通过模拟真实对象的行为,使我们能在不依赖外部系统的情况下,专注测试代码的核心逻辑。对于测试开发、自动化测试,乃至性能测试中的某些场景,合理使

    20分钟前
    00
  • UCB的硅光MEMS OCS控制技术

    昨天写的旭创与nEye合作了一个64端口硅光OCS一、光电路交换技术概述(一)电交换与分组交换电路交换的概念源于早期的电话交换机,通过物理连接实现设备间的通信,就像早期打电话时,接线员手动连接线路一样。而分组交换则是

    11分钟前
    00
  • module &#x27;torch.

    踩坑Ascend, 安装 pytorch 2.5.1 和 pytorch_npu 2.5.1, import torch 报错.执行 python -c "import torch;import torch_npu;"时

    8分钟前
    10
  • 【Docker项目实战】使用Docker部署IT工具箱Team·IDE

    一、Team·IDE介绍1.1 Team·IDE简介Team IDE 是一款集成多种数据库(如 MySQL、Oracle、金仓、达梦、神通等)与分布式系统组件(如 Redis、Zookeeper、Kafka、Elasticsearch)管理

    6分钟前
    00
  • 重装系统只影响C盘吗?深入解析系统重装的全过程

    重装系统只影响C盘吗?深入解析系统重装的全过程 在计算机的日常使用中,重装系统是一个常见的操作,尤其是在系统出现故障、感染病毒或需要优化系统性能时。然而,许多用户对于重装系统的具体过程和影响存在误解,认为重装系统仅仅是对C盘进行清空和重置

    5分钟前
    00
  • 拥抱国产化:转转APP的鸿蒙NEXT端开发尝鲜之旅

    本文由转转技术团队赵卫兵分享,原题“鸿蒙新篇章:转转 APP 的 HarmonyOS Next 开发之旅”,下文进行了排版优化和内容修订。1、引言2023 年在华为开发者大会(HDC.Together)上,除了面向消费者的 HarmonyO

    3分钟前
    00

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信