Problem: Error with ajv module when creating React project using create-react-app
Issue:
When trying to create a React project with create-react-app, I encounter an error stating “Cannot find module ‘ajv/dist/compile/codegen’.”
Although ajv module is listed in package-lock.json, it doesn’t seem to work correctly.
Environment:
Node.js: Version 20.15.0 (Exact Node.js version needs verification)
npm: Version 10.7.0
create-react-app: Version 5.0.1
Steps Tried:
Attempted to reinstall modules with npm install, but the issue persists.
Cleared npm cache and retried, but encountered the same error.
Considering updating Node.js and npm to the latest LTS versions as a potential solution.
Exploring the option of downgrading create-react-app version to troubleshoot the issue.
Additional Information:
Previously, I have successfully used create-react-app in the same environment without any issues. This problem has arisen recently.
Using yarn in a different project does not result in similar issues.
Request for Help:
Any advice or solutions regarding this current situation would be greatly appreciated. I’m seeking assistance to resolve this issue effectively.
양우정 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.