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

Flutter项目pub get失败(错误码66)求助:依赖路径不存在

解决Flutter中integration_test路径不存在导致的pub get失败问题

错误核心信息

Because url_launcher_example depends on integration_test from path which doesn't exist (could not find package integration_test at "......\integration_test"), version solving failed.
pub get failed
exit code: 66

解决步骤

  • 检查并修正pubspec.yaml依赖配置
    打开项目根目录的pubspec.yaml,找到integration_test相关配置:

    • 若配置是本地路径引用(类似path: ../integration_test),先确认指定路径下是否存在完整的integration_test包(需包含自身的pubspec.yaml文件);路径错误的话修正为正确的相对/绝对路径。
    • 若无需本地依赖,直接改用Flutter SDK自带的包:
      integration_test:
        sdk: flutter
      
  • 清理缓存并重跑pub get
    执行命令清理pub缓存:

    flutter pub cache clean
    

    回到项目目录重新获取依赖:

    flutter pub get
    
  • 排查命令参数问题
    你执行的命令带有--example参数,该参数用于获取示例项目依赖。如果是开发自己的项目,直接执行flutter pub get即可,避免因示例项目的依赖配置异常导致失败。

  • 确认项目结构合理性
    如果必须使用本地路径的integration_test,核对项目层级是否匹配配置的路径:比如你的项目在xxx/url_launcher_example,那么../integration_test对应xxx/integration_test,确保该目录存在且是有效的Flutter包。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.25 19:17:37