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' #875
Comments
Sorry, can't be fixed on our side, please reinstall dependencies, something wrong on npm side |
@stevesum Hey, I'm encountering the same error. No luck reinstalling dependencies. Have you figured a workaround? |
Please create reproducible test repo |
@alexander-akait @stevesum I've found a workaround by installing ajv manually Sorry I don't have the time to create a test repo. |
@nooxx Weird, we already have it https://github.com/webpack/schema-utils/blob/master/package.json#L49, maybe you can provide full stack of the error or more information? |
Thanks, @nooxx I will try it. I have no other workaround but simply downgrade the min-css-extract-plugin to 2.4.4 what works well. But have to care about not adding with "^2.4.4" but the fix version "2.4.4" |
@stevesum Maybe you can create reproducible test repo? Also please run |
added ajv as dependency. Remove this if build is fixed without it. Refer: webpack-contrib/mini-css-extract-plugin#875
|
@alexander-akait my npm ls is complaining css-minimizer-webpack-plugin@3.4.1 has an unmet peer dependency ajv@8.10.0.
ajv@8.10.0 is both there, and not ... ? from digging a little more i found serverless/serverless#8727 (comment) according to that, the fix is to upgrade to npm >= 7, but in the case of my project i haven't been able to get that to succeed without errors quite yet. downgrading mini-css-extract-plugin to schema-utils@3.1.1 would likely fix the problem. i have other webpack stuffs using that without issue. Edit: the only way i could get things building was to do the following:
|
one final post to hopefully save someone else some time. if you're hitting this issue, you've found a very old npm bug that went unfixed until npm 7. there is no workaround and the recommendation is to upgrade to npm >= 7. but.... npm >= 7 has a years old issue with private registries and you might not be able to use it if you're installing private packages e.g. github private registry my fix in my previous comment wasn't portable, but this should be:
i then removed node_modules and did a clean install and webpack would now build. i also kept |
- based on webpack-contrib/mini-css-extract-plugin#875, update npm version
I added this dependency and it solved the issue:
|
webpack-contrib/mini-css-extract-plugin#875 Bug is fixed in npm 7, then ajv can be removed
Tried reinstalling dependencies but not working. |
You should not have any issues regarding package prefixes if you use npm ci instead of npm i when generating modules, checks syncronization between package and package.lock, giving priority to lock |
I still reproduce the problem under |
Having missing ajv errors coming from this package as well (with this package being a dependency of react-scripts). Npm 8 |
ExplainMy Condition
Leads to -
Failed Attempts
Guessing reason - The Successful AttemptRun
|
@SevenOutman That worked thanks! |
I had the same issue with |
IT COULD BE MUCH BETTER IF I HAD MONEY TO BUY TIME TRAVEL STUFF DEAR ORPRESSORS |
|
Bug report
Actual Behavior
When trying to run webpack build a project with min-css-extract-plugin, it failed.
[webpack-cli] Failed to load 'C:\Work\Projects\felleskatalogen\felleskatalogenweb-components\web-components-web\framework\webpack.config.js' config [webpack-cli] Error: Cannot find module 'ajv/dist/compile/codegen'
I also saw WARN on npm install about
ajv-keywords@5.1.0 requires a peer of ajv@^8.8.2 but none is installed. You must install peer dependencies yourself.
As I figured out, the version "2.4.5" depends on "schema-utils": "^4.0.0" what depends on the "ajv-keywords": "^5.0.0" what cause this problem.
Expected Behavior
The build should not thrown exeption, and the min-css-extract-plugin should use the right dependencies.
The plugin version "2.4.4" works as expected.
How Do We Reproduce?
package.json
webpack.config.json
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationThe text was updated successfully, but these errors were encountered: