You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行npm start时提示找不到模块'ajv/dist/compile/codegen'求助

解决「无法找到模块 'ajv/dist/compile/codegen'」错误

首先还原你遇到的启动错误:

task-manager@0.1.0 start
react-scripts start

无法找到模块 'ajv/dist/compile/codegen'
调用栈:

试试以下几个解决步骤,按顺序执行:

  • 删除项目根目录下的node_modules文件夹,以及package-lock.json(使用npm时)或yarn.lock(使用yarn时)文件
  • 重新安装所有依赖:
    • npm用户执行:npm install
    • yarn用户执行:yarn install
  • 如果重装后问题依旧,手动安装指定版本的ajv模块,大概率是依赖版本兼容问题:
    npm install ajv@8.12.0
    
  • 若以上都无效,清除npm缓存后再重装:
    npm cache clean --force
    npm install
    

内容的提问来源于stack exchange,提问作者Sahan Silva

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 20:02:01