Error: Cannot find module 'ajv/lib/refs/json-schema-draft-06.json'
See original GitHub issueLooks like the latest release (8.0.4) no longer contains the lib
folder.
https://github.com/ajv-validator/ajv/commit/c4de1a4628757527a579ad179adf29c462acad1b#r49028541
Error: Cannot find module 'ajv/lib/refs/json-schema-draft-06.json'
Require stack:
- /home/runner/work/cspell/cspell/packages/cspell-types/node_modules/ajv-cli/dist/commands/ajv.js
- /home/runner/work/cspell/cspell/packages/cspell-types/node_modules/ajv-cli/dist/commands/compile.js
- /home/runner/work/cspell/cspell/packages/cspell-types/node_modules/ajv-cli/dist/commands/index.js
- /home/runner/work/cspell/cspell/packages/cspell-types/node_modules/ajv-cli/dist/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/runner/work/cspell/cspell/packages/cspell-types/node_modules/ajv-cli/dist/commands/ajv.js:10:26)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/runner/work/cspell/cspell/packages/cspell-types/node_modules/ajv-cli/dist/commands/ajv.js',
'/home/runner/work/cspell/cspell/packages/cspell-types/node_modules/ajv-cli/dist/commands/compile.js',
'/home/runner/work/cspell/cspell/packages/cspell-types/node_modules/ajv-cli/dist/commands/index.js',
'/home/runner/work/cspell/cspell/packages/cspell-types/node_modules/ajv-cli/dist/index.js'
]
}
What version of Ajv are you using? Does the issue happen if you use the latest version?
Ajv options object
JSON Schema
Sample data
Your code
Validation result, data AFTER validation, error messages
What results did you expect?
Are you going to resolve the issue?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
require a json file results in an error: Cannot find module
I had a similar problem when trying to import json from a file in a typescript project. I used
Read more >Issues - GitHub
Error : Cannot find module './types.json' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) ...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
Why the "Error: cannot find module" Occurs. This error occurs because of the following reasons: you're trying to import an item from a ......
Read more >[Solution] Error: Cannot Find Module "nodemailer" - Courier
js project that creates an empty package.json file. Afterward, install the nodemailer library using the command shown below. 1 ...
Read more >Error: Cannot find module in JavaScript [SOLVED]
We can solve Error: Cannot find module by installing the missing module. ... folder holding the package.json file and execute the above command...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
right… I am reverting it. Best to leave it till v9
@epoberezkin,
Thank you for the quick reply. I’m using
ajv-cli
with nothing special.Here is the ajv-cli/ajv.ts line with the issue: