ajv: missing file
In the last v6.6.0 release, there is a missing file:
Error: Cannot find module 'ajv/lib/compile/equal'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/home/travis/build/fastify/fastify/node_modules/table/dist/validateConfig.js:2:13)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Module.replacementCompile (/home/travis/build/fastify/fastify/node_modules/nyc/node_modules/append-transform/index.js:58:13)
at Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Object.<anonymous> (/home/travis/build/fastify/fastify/node_modules/nyc/node_modules/append-transform/index.js:62:4)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/home/travis/build/fastify/fastify/node_modules/table/src/makeConfig.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:722:30)
See https://travis-ci.org/fastify/fastify/jobs/461147572 and https://github.com/fastify/fastify/issues/1281.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 23
- Comments: 23 (6 by maintainers)
Commits related to this issue
- chore: pin ajv to 6.5.5 (#1282) Needed because of #1281 and https://github.com/epoberezkin/ajv/issues/889. — committed to fastify/fastify by mcollina 6 years ago
- Add resolution of ajv to fix broken dependency The internet is a weird place: https://github.com/epoberezkin/ajv/issues/889 — committed to selbekk/react-christmas by deleted user 6 years ago
- [chore] Cannot find module 'ajv/lib/compile/equal' https://github.com/epoberezkin/ajv/issues/889 — committed to Martha1001/react-study by Martha1001 6 years ago
Other solution is to add a manual resolution in the package.json:
then you can use both
yarn
ornpm
I will revert, it’ll go out in the next major version. Give me an hour - just landed 😃
So it appears that several libraries depended on an internal file that was not public (I think) and that became one-line wrapper around fast-deep-equal long time ago… Who would have thought 😃
@mcollina @gajus could you please replace require(“ajv/lib/compile/equal”) with require(“fast-deep-equal”)? I won’t be able to revert for several hours I am afraid.
Yes, that’s why I probably kept it at the time… it’s published
So “equal.js” is public as it turned out… https://github.com/epoberezkin/ajv/issues/889#issuecomment-442784790
Sorry
Temporary workaround summary
Add a below field to your
package.json
.Yarn
NPM
resolutions not support by npm.
For npm you need to “ajv”: “6.5.4” dependencies in package.json
@ybiquitous it works for both
Everyday we break semver 😆 J/K
@epoberezkin Publish v6.6.1 please.
Yeah - I was looking at the problem in
table
(gajus/table#83), and it appears that this update needs to be a major version, as it otherwise could break validators generated from previous versions of the library (usingajv-cli
, in the case oftable
).Good old release and run routine…