-
-
Notifications
You must be signed in to change notification settings - Fork 872
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
Error: Cannot find module 'ajv/dist/compile/codegen' #2443
Comments
Same issue, without craco. `Cannot find module 'ajv/dist/compile/codegen'
npm ERR! A complete log of this run can be found in: |
Also facing the same issue... |
Project that was working suddenly starting giving this same error.. |
I also facing the same problem. |
Seems like new version: 8.15.0 causes this bug. Our project stopped building however nothing had been changed. |
Has a similar issue |
8.14 started the issue for my project. We pinned to 8.13 for now to get things to work. Any updates on a fix? |
We saw the same issue on our side. We had to pin to 8.14 |
I`m getting same issue |
same issue here... |
if you are use like this |
Thanks mate!! That solved my issue. you saved my day! |
Same issue here also. --force command helped me. Thanks for your valueable help. |
Same issue in azure build pipeline, local is working fine |
same in gcp cloud build |
have that same with jest in one project and webpack in another project |
Version 8.16 did NOT fix the issue |
the problem is not in this module it is in ajv-keywords ajv-keywords tries to get v8 but receives v6 I have found a solution to add |
this worked |
Такая же проблема при запуске React.Как кто боролся подскажите? |
Can everyone please try 8.16.0? |
Please update to 8.16.0 and let me know. |
I wrote above that version 8.16 did not help either. |
this does not help |
Try freezing |
Is it possible one of your other dependencies is pulling in the broken version (8.15.0) because 8.16.0 is identical to 8.14.0 apart from the version number (see this diff tool). If you look at your lock files do you see multiple versions of AJV mentioned? |
I just saw this, maybe this issue is not related to the broken 8.15.0 release? I will look into it further. Maybe there's an issue that ajv-keywords is pointing at an old version of AJV. |
Oh and it would be much appreciated if someone can give me a simple example repo that reproduces the issue. With as few other dependencies as possible thanks! |
try this one https://github.com/Gemunion/nestjs-database not the smallest one but I do not have another
the fix is in this commit |
This fixed it for me, hope this helps:
|
tried everything still now solved |
|
We are facing same issue from 6th June 2024. We are using ajv 8.16.0 and ajv-keywords 5.1.0 version. Suddenly it stopped working when we were creating new build. Posting error stack to check the issue. Node version used 14.18.3. internal/modules/cjs/loader.js:905 Error: Cannot find module 'ajv/dist/compile/codegen'
|
Add a newer version of
"devDependencies": {
...
"ajv": "^8.16.0",
...
},
"overrides": {
"ajv": "^8.16.0"
}, This explicitly indicates you force your dependencies to use this version https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides |
I also get the same error, and I can´t even find "ajv" anywhere in my solution. Nothing with my build files or package.json has changed, it just stopped working from one day to another.
node:internal/modules/cjs/loader:1143 Error: Cannot find module 'ajv/dist/compile/codegen'
|
please check your package.lock.json. There you will find "ajv" package. Hopefully, it should help you. |
Just run this command "npm install [email protected] [email protected] [email protected] --save-dev" . It will add package in package.json file and then it will point to 8.16v only, hopefully will not give error . But you can build it to see if any error comes. |
That worked great. Thank you :) |
The only explanation I can think of, if it is related to the broken release edit: Also I noted some older versions of node being used, it would be interesting, if possible, to try a newer version. AJV recently removed node 12 and 14 from our testing matrix. This doesn't mean we did anything specific to break on older versions of node, but that we're not focussed on them anymore. |
this works for me. Thanks |
Has this issue died off? I'm wondering if there is a real issue that needs addressing or if it was just the nature of deep dependency chains that the bad version took a while to get out of the system (and in some cases people needed overrides to get there faster)? |
Thanks ! It worked! |
this "npm install ajv --save-dev" resolves the issue |
essa solução me atendeu bem...OBRIGADO ! |
I'm going to assume this is resolved and anyone needing to do |
If you use |
While build process using Craco Getting error Cannot find module 'ajv/dist/compile/codegen'
Below is the call stack generated By craco Build using node version "v16.15.1" and npm version "8.11.0". This issue is reproducible once we delete node_modules and package-lock.json. Installing packages and using craco build will result in the above error. ajv is not used as dependency in the project.
Require stack:
The text was updated successfully, but these errors were encountered: