-
-
Notifications
You must be signed in to change notification settings - Fork 49
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' #385
Comments
developer-73
changed the title
Add "ajv" as its dependency instead of devDependency
Error: Cannot find module 'ajv/dist/compile/codegen'
Mar 30, 2023
GuiDevloper
added a commit
to GuiDevloper/nullstack-adapters
that referenced
this issue
Jun 9, 2023
Remove `ajv` npm dep fix for [this](ajv-validator/ajv-keywords#385) applied today because of TurboCLI used by StackBlitz. Reason: exactly today they deprecated it and opted in using native npm 🤡
I seem to be encountering the very same issue you have. Were you able to find a fix for it? |
In order to prevent this disagreement at the top level of So in your "schema-utils": "^3.3.0",
"ajv": "^6.12.6",
"ajv-keywords": "^3.5.2", or: "schema-utils": "^4.2.0",
"ajv": "^8.12.0",
"ajv-keywords": "^5.1.0", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am facing this build error in "ajv-keywords" after installing packages with
npm install --legacy-peer-deps
Error: Cannot find module 'ajv/dist/compile/codegen'
Background:
Consider the following dependency trees:
Notice: with
npm install --legacy-peer-deps
(1st tree) gives incorrect tree structure and not withnpm install
(2nd one).npm install --legacy-peer-deps
results in following error onnpm run build
:Error: Cannot find module 'ajv/dist/compile/codegen'
I have prepared a repo at https://github.com/developer-73/ajv-peerdep-issue.
I am using following devDependencies ::
"babel-loader": "9.1.2",
"eslint": "8.36.0"
ajv@^8.8.0 and ajv-keywords@^5.0.0, where ajv-keywords has a peer dependency on ajv@^8.8.0
Run
npm install --legacy-peer-deps
and notice the incorrect tree structure in node_modules i.e. [email protected]gets hoisted on the root level of node_modules and is using incorrect version of [email protected].
This is a problem because the hoisted ajv-keywords@^5.0.0 will not have its peer dependency on ajv@^8.8.0 met.
Note: This works correctly on npm < 7
Possible solution: Can you please add "ajv" as your packages dependencies instead of devDependency? This will ensure "ajv-keywords" to get latest "ajv" version
The text was updated successfully, but these errors were encountered: