question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot start new project due to Ajv error

See original GitHub issue

Is this a bug report?

Yes

Did you try recovering your dependencies?

No

Which terms did you search for in User Guide?

None

Environment

Environment Info:

  System:
    OS: macOS 10.14.2
    CPU: x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
  Binaries:
    Node: 10.12.0 - /usr/local/bin/node
    npm: 6.7.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 71.0.3578.98
    Safari: 12.0.2
  npmPackages:
    react: ^16.8.1 => 16.8.1 
    react-dom: ^16.8.1 => 16.8.1 
    react-scripts: 2.1.3 => 2.1.3 
  npmGlobalPackages:
    create-react-app: Not Found

Steps to Reproduce

  1. npx create-react-app my-app --typescript
  2. cd my-app
  3. npm start

Expected Behavior

Starting the development server

Actual Behavior

Build exits with status 1 and the following error appears:

> react-tutorial-app@0.1.0 start /Users/pawel/Projects/react-tutorial-app
> react-scripts start

/Users/pawel/Projects/react-tutorial-app/node_modules/ajv/lib/keyword.js:65
      throw new Error('custom keyword definition is invalid: '  + this.errorsText(validateDefinition.errors));
      ^

Error: custom keyword definition is invalid: data.errors should be boolean
    at Ajv.addKeyword (/Users/pawel/Projects/react-tutorial-app/node_modules/ajv/lib/keyword.js:65:13)
    at module.exports (/Users/pawel/Projects/react-tutorial-app/node_modules/ajv-errors/index.js:10:7)
    at Object.<anonymous> (/Users/pawel/Projects/react-tutorial-app/node_modules/schema-utils/src/validateOptions.js:22:1)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-tutorial-app@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1

Reproducible Demo

Not available

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:15
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
viankakrisnacommented, Feb 9, 2019

just add

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

to your package.json

if you use yarn: run yarn install

if you use npm: https://github.com/rogeriochaves/npm-force-resolutions TL;DR

rm -rf node_modules
npx npm-force-resolutions
npm install
1reaction
MattGerardcommented, Feb 10, 2019

As a short term adding “ajv”: “6.8.1” to package.json deps should also work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ajv: Another JSON Schema Validator - npm
Start using ajv in your project by running `npm i ajv`. ... with parameters describing error reasons to allow creating custom error messages ......
Read more >
Ajv: Another JSON Schema Validator - Gitlab
Ajv : Another JSON Schema Validator. The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/07.
Read more >
How to create custom error messages using AJV?
I would like a different message depending on the error for instance minLength or format but I would like to define what this...
Read more >
Ajv JSON schema validation - YouTube
Ajv JSON schema validation. Watch later. Share. Copy link. Info. Shopping. Tap to unmute. If playback doesn't begin shortly, try restarting ...
Read more >
Ajv: Another JSON Schema Validator - Global Data Plane
Related packages; Packages using Ajv; Tests, Contributing, History, License ... allow creating validation scenarios that cannot be expressed using JSON- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found