Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start new project due to Ajv error #6385

Closed
pwolaq opened this issue Feb 9, 2019 · 12 comments
Closed

Cannot start new project due to Ajv error #6385

pwolaq opened this issue Feb 9, 2019 · 12 comments

Comments

@pwolaq
Copy link

pwolaq commented Feb 9, 2019

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

@BrianMitchL
Copy link

AJV issue: ajv-validator/ajv#941

@tetreault
Copy link

placing this comment here as well since i see it referenced. this broke a fresh Nuxt project for me. Doing npm i -d ajv@5.0.0 resolved it for now.

@viankakrisna
Copy link
Contributor

workaround for yarn users:
add

  "resolutions": {
    "ajv": "6.5.5"
  }

to your package.json and re run yarn install

@vi11ain
Copy link

vi11ain commented Feb 9, 2019

this issue drove me crazy!
@tetreault not working for me ):

@viankakrisna
Copy link
Contributor

viankakrisna commented 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

@vi11ain
Copy link

vi11ain commented Feb 9, 2019

@viankakrisna what do you know? switched to yarn and it worked like magic! thanks alot 😄

@guix77
Copy link

guix77 commented Feb 10, 2019

Thanks guys!

@MoralesJonathan
Copy link

@viankakrisna adding resolutions worked for me! Thanks

@fdemian
Copy link

fdemian commented Feb 10, 2019

Last fix worked for me, although I would like to see a more general resolution.

@ianschmitz ianschmitz pinned this issue Feb 10, 2019
@MattGerard
Copy link

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

@GennYoon
Copy link

updated ajv version 6.7.0 -> 6.9.0
downgrade version

yarn add ajv@6.7.0 or npm install ajv@6.7.0

@ianschmitz
Copy link
Contributor

ajv@6.9.1 is out and should fix this issue. Please let us know if you continue to have issues. Make sure to delete your node_modules and lock files to ensure you grab the latest package.

@petetnt petetnt unpinned this issue Feb 11, 2019
@petetnt petetnt pinned this issue Feb 11, 2019
@ianschmitz ianschmitz unpinned this issue Feb 11, 2019
@lock lock bot locked and limited conversation to collaborators Feb 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests